Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.  
# A - Grouping
a=['1','3','5','7','8','10','12']
b=['4','6','9','11']
x,y=list(map(int,input().split()))
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")


# A - Grouping
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
x,y=list(map(int,input().split()))
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")

