Easy
The Knight's Path Check
In chess, a knight moves in an "L" shape: two squares in one direction and one square perpendicular to that, or vice versa.
Given two positions on a standard 8x8 chessboard, determine if a knight can move directly from the start position to the end position in exactly one move.
Positions are given as coordinates (row, column) where both row and column range from 1 to 8.
Input Format
The first line contains two integers r1 and c1 (the starting position). The second line contains two integers r2 and c2 (the ending position).
Output Format
Print "YES" if the knight can move from start to end in exactly one move, otherwise print "NO".
Examples
Example 1
Input
1 1
2 3
Output
YES
ExplanationFrom (1,1), the knight can reach (2,3) by moving 1 down and 2 right.
Example 2
Input
1 1
1 2
Output
NO
ExplanationThe knight cannot move from (1,1) to (1,2) in one L-shaped move.
Constraints
•
1 ≤ r1, c1, r2, c2 ≤ 8
Code
Python
Error
Case 1
Case 2
Input
1 1
2 3
Output
No output
Expected
YES
