_, Y_1, _, Y_2, _ = map(int, input().split()) ans = ('No', 'Yes') print(ans[Y_1 == Y_2])