Queen and King#3453

Queen and King

1 second
64 megabytes
Very easy

Vasya is delving into chess endgames and finds using a computer helpful for analyzing positions. He needs a program to determine if the black king is in check.

For this task, consider a scenario where only three pieces are on the board: a white king, a white queen, and a black king. The black king is in check if the white queen can move to the square occupied by the black king in one move. The queen can move vertically, horizontally, or diagonally, but unlike a knight, it cannot jump over other pieces.

Input

The input consists of a single line containing the positions of three squares on the chessboard, separated by spaces: the white king's position, the white queen's position, and the black king's position. It is guaranteed that the black and white kings are not on adjacent squares.

Output

Print "YES" if the black king is in check, and "NO" if it is not.

Examples

Example 1

Loading
Loading