eolymp
bolt
Try our new interface for solving problems
Problems

Frog VS mosquito: the last fight!

Frog VS mosquito: the last fight!

Time limit 1 second
Memory limit 128 MiB

The forest swamp is divided into 8 * 8 identical cells. A frog sits in one of the cells, and a mosquito flies over some other cell. The frog wants to eat a mosquito, and the mosquito tries to fly away from it (avoiding death in the belly of a frog). The frog and the mosquito move in turn.

prb4895

In one jump, the frog moves horizontally or vertically to any non-zero number of cells. The mosquito in one flight moves to one of the 8 neighboring cells (horizontally, vertically or diagonally). If a frog jumps through a cell, over which there is a mosquito or jumps directly to this cell, then it eats the mosquito. The frog can move one square diagonally, if this way it eats the mosquito.

Make a program that, given the initial position of the frog and the mosquito, will determine if the frog can eat a mosquito.

A frog and a mosquito can not miss the moves (can not stay in place). The mosquito and the frog can be on the same cell, and if this happened in the frog move, then no move will lead to the mosquito being eaten.

Input data

Contains some (up to 1000) tests. Each test is given in separate line and contains 5 numbers X[L] Y[L] X[K] Y[K] M, space separated. Here X[L] Y[L] is the starting frog's position, X[K] Y[K] is the starting mosquito's position, M means who makes first move: 0 - frog, 1 - mosquito.

The end of the tests is given by the number 0 in a separate line.

Output data

Print for each test the answer in a separate line. You should print YES if, under the optimal strategy of both, the frog will eat a mosquito, and NO otherwise.

Examples

Input example #1
1 1 3 4 1 
5 4 2 3 1
3 4 1 1 0
5 5 3 5 1
2 3 5 2 0
1 2 3 4 1
4 5 6 8 1
0
Output example #1
NO
NO
YES
NO
NO
NO
NO
Source 2005 Petrozavodsk, SPb ETU Contest, August 25, Problem D