Given is a polyline that only turns at right angles. Find out whether it is possible to connect the ends of the polyline by an arbitrary curve that doesn't contain any other point of the polyline. ------------------------------------------------------------------------------------------------- The first line of input contains the integer n: the number of vertices of the polyline. You may assume that 1 <= n <= 1000. Each of the following n lines contains the coordinates of one vertex, in order. All coordinates are between 0 and 10^9, inclusive. You may assume that each segment of the polyline has a non-zero length and that the segments alternate between horizontal and vertical ones. Note that it is possible that the polyline intersects or even overlaps itself. The curve can go through any point in the plane, it is not limited to the range between 0 and 10^9. ------------------------------------------------------------------------------------------------- Output a single line with the string "yes" if a valid curve exists, or "no" if it doesn't. ------------------------------------------------------------------------------------------------- Example input: 8 5 5 6 5 6 6 5 6 5 4 4 4 4 5 5 5 Example output: yes Explanation: The polyline starts and ends at the same point. The curve we are looking for trivially exists -- it consists of that single point. ------------------------------------------------------------------------------------------------- Example input: 7 5 5 5 6 6 6 6 4 4 4 4 6 7 6 Example output: no ------------------------------------------------------------------------------------------------- Example input: 4 0 0 10 0 10 10 20 10 Example output: yes