Mirrors#757

Mirrors

1 second
64 megabytes
Easy

Once upon a time, the evil wizard Saruman looked into a video chat and discovered a system of mirrors. He pondered for a long time before realizing, as his inner voice suggested, that the system was not simple. He understood that if he could look at a specific point through all mirrors from a certain angle (so that his gaze is reflected by each mirror exactly once, then reaches point ), all the secrets of the internet would be revealed to him.

However, the forces of good were not idle and, through their agents, learned everything about this video chat.

Your task is to write a program to help the forces of good determine the angle at which to look at the system of mirrors to learn all the secrets of the internet.

Input

The first line of the input contains a single number — the number of mirrors (0 < N \leq 10). The next line contains the coordinates ( and , where the axis points right and the axis points upwards) of the observation point and of point . Then, each of the next lines contains information about a mirror — four numbers representing the coordinates of the start and end points of the mirror. The reflective surface is on the left side of the mirror (when moving from the first point to the second). The back side of the mirror is transparent.

The following constraints apply:

  • All coordinates are real numbers and do not exceed in absolute value.

  • No mirrors intersect.

  • The observation point and point do not lie on any of the mirrors.

Output

The first line of the output should contain YES if a solution exists, and NO if it does not. If a solution exists, the second line should specify the angle in degrees (to six decimal places) at which to look at the mirrors. The angle is measured counterclockwise from the axis and is between and degrees.

Examples

Example 1

Loading
Loading