N-polygons in hyperbolic geometry Let  $N$ be  an integer and we have two $N$-polygon $A_{1}A_{2}\ldots A_{N}$ and $A'_{1}A'_{2}\ldots A'_{N}$ such that the length of geodesic $A_{i}A_{i+1}$ is equal to the length of geodesic $A'_{i}A'_{i+1}$ for $i=1,2,\ldots n-1$ and $A_{N}A_{1}=A'_{N}A'_{1}$

Is there an isometry of Poincare upper half plane which carries the first polygon to the second polygon?

 A: no, take $N=4,$ one figure is a "square" with four equal edges and four equal angles at the vertices. The other figure is a rhombus, same four edges but hte vertex angles in two pairs. For example, we could just glue two equilateral triangles together along one edge.
Isometries preserve angles too. 
A: I claim that such a (possibly anticonformal) isometry exists if $N=3$ and the $A_i$ are not on the boundary of the plane, and may or may not otherwise.
For $N=3$, consider the case of $A_1 = i$ and $A_2 = ti$ where $0<t<1$. Note that, using the usual metric $A_1 A_2 = -2\ln(t)$. Assume that we are given $A_1 A_3 = R$. Consider the hyperbolic circle, centred at $i$ with radius $R$. Clearly, $A_3$ is on this circle. The distance from $A_2$ to a point on this circle varies from $R+2\ln(t)$ to $R-2\ln(t)$, and for each value between those extremes there are two points which have that distance, one with negative real part, and one with positive. So, given that we fix whether the $A_i$ traverse the vertices of the polygon in clockwise, or anticlockwise fashion, we have a unique triangle with $A_1 = i$, $A_2$ on the imaginary axis between $A_1$ and $0$, and with side lengths satisfying $A_1A_2 = -2\ln(t)$, $A_2A_3 = r$ and $A_3 A_1 = R$.
Now, imagine that we have $B_1, B_2$ and $B_3$ where $B_i B_j = A_i A_j$. We need to find an isometry that maps $B_i$ to $A_i$. Recall that the isometries are moebius transforms with real coefficients. If $B_1 = x +iy$, then if we act with $z \mapsto z - x$ and then $z \mapsto z/y$, we map $B_1$ to $A_1$, and I claim that both of these maps are isometries, and we'll call their composition $f$. Next, consider the transforms of the form $z\mapsto \frac{\cos(\theta)z + \sin(\theta)}{-\sin(\theta)z +\cos(\theta)}$. They fix $i$ and are, essentially, rotations about it. One such rotation, when composed with $f$, maps $B_2$ to $A_2$, and we'll call it $g$.
Now, $g\circ f(B_3)$ must be one of the the two points on the circle radius $R$, centred $i$. If its not $A_3$, then the question is whether we accept $x+iy \mapsto -x +iy$ as  an isometry: it preserves distance, but is anticonformal rather than conformal, and, for instance, isn't a moebius transform. Whether one includes such things as being isometries is more a matter of definition than anything else.
Ignoring this point about anticonformality, if we have two triangles with the same lengths as $A_1 A_2 A_3$, then we can map both of them to $A_1 A_2 A_3$, and therefore we can map them to each other.
Now, regarding the case of points on the boundary, I claim that there is a one dimensional family of triangles with one point on the boundary and side lengths $r, \infty$ and $\infty$ (place $A_1$ and $A_2$ as before and index the set with the third vertex, an element of $\mathbb{R}\cup \infty$), another one dimensional family with two points on the boundary and side lengths all infinite, and a unique, up to conjugacy, triangle with all points on the boundary.
Now, for more vertices, consider a triangulation of the polygon. If there is to be an isometry of the figures, all the triangles must be congruent. But, as we have seen, there is a unique triangle with side lengths $r, s$ and $t$ for all finite positive reals. By specifying that only $A_i A_{i+1} = A'_i A'_{i+1}$ are equal, we don't guarantee the congruency of the triangles in the triangulation. To do that, we'd need something like $A_1 A_i = A'_1 A'_i$.
That's a pretty vague treatment, you need a proper text. I got pretty good value out of Anderson's "Hyperbolic Geometry", but anyway, I hope this helps.
