group1=[1,3,5,7,8,10,12]

group2=[4,6,9,11]

group3=[2]

a,b=list(map(int,input().split()))

if(a==2 and b==2):

  print('Yes')

elif(((a in group1) and (b in group1)) or ((a in group2) and (b in group2))):

  print('Yes')

else:print('No')
a=[1,3,1,2,1,2,1,1,2,1,2,1]

x,y=list(map(int,input().split()))

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

a = [1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
x, y = list(map(int, input().split()))
print(("Yes" if a[x - 1] == a[y - 1] else "No"))

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