  We derive global consistency condition for strongly coupled heterotic string
in the presence of M5-branes. Its elliptic genus is interpretable as generating
functional of anomaly polynomials and so, on anomaly-free vacua, the genus is
both holomorphic and modular invariant. In holomorphic basis, we identify the
modular properties by calculating the phase. By interpreting the refinement
parameters as background curvature of tangent and vector bundles, we identify
the extended Bianchi identity for Kalb--Ramond field of heterotic M-theory in
the presence of arbitrary numbers of M5-branes.
