← Problem book: C Lesson 22 of 96 · 10 XP

Rook move

Theory and problem statement

Machine translation, not yet reviewed by a native speaker.

You are given two different squares of a chessboard: the column and row of the first, then the column and row of the second (numbers from 1 to 8, all on one line). Print YES if a rook can move from the first square to the second in one move, otherwise NO.

Example

Input:

1 1 1 8

Output:

YES

Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.