← Back to List

23885번: 비숍 투어 ↗

Solutions

Python 3
261 B | 261 chars
n, m = map(int, input().split())
a, b = map(int, input().split())
c, d = map(int, input().split())


if n == 1 or m == 1:
    if a == c and b == d:
        print("YES")
    else:
        print("NO")
else:
    print("YES" if (a + b) % 2 == (c + d) % 2 else "NO")