A, B = map(int, input().split())
if (A, B) == (1, 2):
    print("Yes")
elif (A, B) == (2, 3):
    print("Yes")
elif (A, B) == (4, 5):
    print("Yes")
elif (A, B) == (5, 6):
    print("Yes")
elif (A, B) == (7, 8):
    print("Yes")
elif (A, B) == (8, 9):
    print("Yes")
