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.  
list = ['1', '3', '5', '7', '8', '10', '12']
list1 = ['4', '6', '9', '11']
list2 = ['2']

x, y = map(int, input().split())
if x in list and y in list:
    print("Yes")
elif x in list1 and y in list1:
    print("Yes")
elif x in list2 and y in list2:
    print("Yes")
else:
    print("No")

a,b = list(map(int,input().split()))
c = [1,3,5,7,8,10,12]
d = [4,6,9,11]
e = [2]
if a in c and b in c:
  print("Yes")
elif a in d and b in d:
  print("Yes")
elif a in e and b in e:
  print("Yes")
else:
  print("No")