  Let $S$ be a nonorientable surface of genus $g\ge 5$ with $n\ge 0$ punctures,
and $\Mcg(S)$ its mapping class group. We define the complexity of $S$ to be
the maximum rank of a free abelian subgroup of $\Mcg(S)$. Suppose that $S_1$
and $S_2$ are two such surfaces of the same complexity. We prove that every
isomorphism $\Mcg(S_1)\to\Mcg(S_2)$ is induced by a diffeomorphism $S_1\to
S_2$. This is an analogue of Ivanov's theorem on automorphisms of the mapping
class groups of an orientable surface, and also an extension and improvement of
the first author's previous result.
