Problems > Same Color Squares

Same Color Squares

Difficulty: 800 2000 ms 128 MB

math

Are the two squares (r1, c1) and (r2, c2) the same color on a standard chessboard coloring?

Input: one line with four integers r1 c1 r2 c2.

Output: YES or NO.

Constraints:

  • 1 ≤ coordinates ≤ 109

Sample Tests

Input 1
1 1 2 2
Output 1
YES
Input 2
1 1 1 2
Output 2
NO

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.