_, y1, _, y2, _ = map(int, input().split()) print("Yes" if y1 == y2 else "No")