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 = [4,6,9,1]
x,y = map(int,input().split())
if x in A:
  x = 1
elif x != 2:
  x = 3
if y in A:
  y = 1
elif y != 2:
  y = 3
if x == y:
  print('Yes')
else:
  print('No')
A = [4,6,9,11]
x,y = map(int,input().split())
if x in A:
  x = 4
elif x != 2:
  x = 3
if y in A:
  y = 4
elif y != 2:
  y = 3
if x == y:
  print('Yes')
else:
  print('No')
