Escaping
Time limit1sMemory limit512 MB
Given officer and thief positions on an infinite grid, decide whether the thief can evade capture forever when all pieces move one step per turn.
Problem
Consider a game of catching a thief on an infinite integer grid. The thief starts at one lattice point, and police officers are placed on different lattice points that do not contain the thief. The thief and the officers take turns moving, and the thief moves first. On the police turn, all officers move at the same time. Each officer and the thief can move to one of the four adjacent lattice points (up, down, left, or right). An officer may stay in place, but the thief must move to a neighboring lattice point on every turn. If an officer and the thief land on the same lattice point, the thief is caught and the game ends. Both sides play optimally. The thief tries to avoid capture, and the police try to catch the thief as quickly as possible.
For a given starting configuration, call it "escapable" if the thief can keep running forever no matter how the police play. For example, in the left figure below, the thief can only move north or south, so the police can never catch the thief. In the right figure, the thief is caught by the police no matter how it runs.

Given the initial positions of the thief and the officers, determine whether the configuration is escapable.
Input
The first line contains the number of police officers , where . The next lines each contain the starting coordinates of one officer, separated by a space. The next line contains the starting coordinates of the thief, separated by a space. All coordinates are distinct lattice points, and the integers satisfy .
Output
If the thief can run forever from the given initial configuration, that is, the configuration is escapable, print YES. Otherwise, print NO.