The authors consider a generalization of the M.A.Lavrentiev inverse problem on a conformal mapping of half-plane onto interiority of a polygon for the case where the set of vertices of this polygon is infinite. We assume that the inner angles at unknown vertices and the image of the vertices under the conformal mapping on the real line are given. Under certain restrictions on values of the angles and on the sequence of points of the real line that are preimages of the vertices the formula for such a mapping is obtained.