Journey
The renowned navigator Ferdinand Magellan has planned an adventurous journey. For this expedition, he has marked several points on the globe that he intends to visit in a specific order. Ferdinand will travel from one point to the next along the shortest possible path (assuming he can always navigate this path with his ship). The globe is modeled as a perfect sphere.
Your task is to determine whether his route will intersect itself, meaning if there will be any point that Ferdinand passes through more than once. Note that the end of one segment and the start of the next naturally coincide and do not count as a self-intersection. Additionally, the start and end of the entire journey may coincide without being considered an intersection.
Input
The first line of the input contains an integer N (1 ≤ N ≤ 5000), representing the number of points Ferdinand must visit in sequence. Each of the following N lines contains 2 integers, specifying the coordinates of each point: latitude ranging from -90 to 90 (positive for the northern hemisphere, negative for the southern) and longitude ranging from -180 to 180 (positive for the eastern hemisphere, negative for the western). It is guaranteed that consecutive points are not diametrically opposite.
Output
Print YES on a single line if the route intersects itself, and NO if it does not.