Point in polygon#2149

Point in polygon

1 second
64 megabytes
Medium

Determine whether a point lies inside or on the boundary of a given polygon.

Input

The first line contains three numbers: (3 \le N \le 100000) and the coordinates of the point. The next lines each contain a pair of integers, representing the coordinates of a vertex of a simple polygon, given in either clockwise or counterclockwise order. All coordinates are integers with absolute values not exceeding .

Output

Output a single line: "YES" if the given point is inside the polygon or on its boundary, and "NO" otherwise.

Examples

Example 1

Loading
Loading