A circle is inscribed in an angle with vertex $O$, touching its sides at points $M$ and $N$. On an arc $MN$ nearest to point $O$, an arbitrary point $P$ is selected. At point $P$, a tangent is drawn to the circle $P$, intersecting the sides of the angle at points $A$ and $B$. Prove that that the length of the segment $AB$ is the smallest when $P$ is its midpoint.