  We consider integrals of tau functions of Zakharov-Shabat systems whose
higher times are related to the eigenvalues of products of random matrices.
Apart of random matrices there is the set of $n$ pairs of given matrices which
play the role of parameters. In terms of these matrices we introduce the
notions of words, dressed words and dual words, these notions are related to
the graphs and dual graphs drawn on a Riemann surface $\Sigma$. The integrals
of tau functions over independent ensembles of random matrices can be computed
in form of series over partitions of products of the Schur polynomials with a
multiplier which depends on the Euler characteristic of the Riemann surface.
This form allows to compare the integrals of tau functions with correlation
functions of certain quantum models. We present a tau function whose integral
is equal to the correlation function of the Wilson loops of the two-dimensional
Yang-Mills model on $\Sigma$.
