Problem:
 Score : 100 points    Problem Statement 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.         Constraints  x and y are integers.  1 ≤ x < y ≤ 12         Input Input is given from Standard Input in the following format:  x  y       Output If x and y belong to the same group, print Yes ; otherwise, print No .        Sample Input 1 1 3      Sample Output 1 Yes       Sample Input 2 2 4      Sample Output 2 No

Solution (Python):
x = [1,3,5,7,8,10,12]
y = [4,6,9,11]
z = [2]
a, b=map(int, input().split())
if (a in x and b in x) or (a in y and b in y) or (a in z and b in z):
    print('Yes')
else:
    print('No')

Solution (Python):
x,y=map(int,input().split())
s0=1<<(x-1)|1<<(y-1)
s1=sum(list(map(lambda x:1<<(x-1),[1,3,5,7,8,10,12])))&s0
s2=sum(list(map(lambda x:1<<(x-1),[4,6,9,11])))&s0
s3=sum(list(map(lambda x:1<<(x-1),[2])))&s0

if s1==s0 or s2==s0 or s3==s0:
  print('Yes')
else:
  print('No')

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

Solution (Python):
x = [1,3,5,7,8,10,12]
y = [4,6,9,11]
z = [2]
a, b=map(int, input().split())
if (a in x and b in x) or (a in y and b in y) or (a in z and b in z):
  print('Yes')
else:
  print('No')

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

Solution (Python):
x, y = map(int, input().split())
a = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
if a[x] == a[y]:
    print("Yes")
else:
    print("No")

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

Solution (Python):
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

x,y = map(int,input().split())
if x in a and y in a:
	print("Yes")
elif x in b and y in b:
	print("Yes")
elif x in c and y in c:
	print("Yes")
else:
	print("No")

Solution (Python):
x, y = map(int, input().split())

g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]

if (x in g1 and y in g1) or (x in g2 and y in g2) or (x in g3 and y in g3):
  print('Yes')
else:
  print('No')

Solution (Python):
d={1:1,3:1,5:1,7:1,8:1,10:1,12:1,4:2,6:2,9:2,11:2,2:3}
a=list(map(int,input().split()))
if d[a[0]]==d[a[1]]: 
    print('Yes')
else: 
    print('No')

Solution (Python):
x=[1,3,5,7,8,10,12]
y=[4,6,9,11]
z=[2]
a,b=map(int,input().split())
if (a in x and b in x) or (a in y and b in y) or (a in z and b in z):
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
elif x in c and y in c:
  print('Yes')
else:
  print('No')

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

Solution (Python):
x, y = map(int, input().split())

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")

Solution (Python):
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
elif x in c and y in c:
    print('Yes')
else:
    print('No')

Solution (Python):
l = [1,3,5,7,8,10,12]
m = [4,6,9,11]
a,b  = map(int,input().split())
if (a in l and b in l) or (a in m and b in m):
  print("Yes")
else:
  print("No")

Solution (Python):
x,y = map(int, input().split())

list1 = [1,3,5,7,8,10,12]
list2 = [4,6,9,11]

L = [list1,list2]

ans = "No"

for i in L:
  if x in i and y in i:
    ans = "Yes"

print(ans)

Solution (Python):
x, y = map(int, input().split())

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or ((x in c and y in c)):
    print("Yes")
else:
    print("No")

Solution (Python):
l1 = [1, 3, 5, 7, 8, 10, 12]
l2 = [4, 6, 9, 11]

x, y = map(int, input().split())
flg = x in l1 and y in l1 or x in l2 and y in l2
print("Yes" if flg else "No")

Solution (Python):
a,b=map(int,input().split())
mydict = {1:"a", 2:"c", 3:"a", 4:"b", 
          5:"a", 6:"b", 7:"a", 8:"a", 9:"b", 10:"a", 11:"b", 12:"a"}
if mydict[a] == mydict[b]:
  print("Yes")
else:
  print("No")

Solution (Python):
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
x, y = 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")

Solution (Python):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]

a,b = [int(i) for i in input().split()]

if a in A and b in A:
    print('Yes')
elif a in B and b in B:
    print('Yes')
else:
    print('No')

Solution (Python):
gp1=[1,3,5,7,8,10,12]
gp2=[4,6,9,11]

x,y=map(int,input().split())
if x in gp1 and y in gp1:
    print('Yes')
elif x in gp2 and y in gp2 :
    print('Yes')
elif x==y==2:
    print('Yes')
else:
    print('No')

Solution (Python):
xy = list(map(int, input().split())) 
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]
if set(xy) <= set(g1) or set(xy) <= set(g2) or set(xy) <= set(g3):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
def LI():
    return list(map(int,sys.stdin.readline().rstrip().split()))  

x,y = LI()

A = [1,3,5,7,8,10,12]
B = [4,6,9,11]

if x in A and y in A:
    print('Yes')
elif x in B and y in B:
    print('Yes')
else:
    print('No')

Solution (Python):
l = set(map(int,input().split()))
print('Yes'if l <= set([1,3,5,7,8,10,12])or l <= set([4,6,9,11] )else 'No')

Solution (Python):
x,y=map(int,input().split())
if {x,y}<={1,3,5,7,8,10,12} or {x,y}<={4,6,9,11}:
  print("Yes")
else:
  print("No")

Solution (Python):

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

grp_dict = {
    1: 'A',
    2: 'C',
    3: 'A',
    4: 'B',
    5: 'A',
    6: 'B',
    7: 'A',
    8: 'A',
    9: 'B',
    10: 'A',
    11: 'B',
    12: 'A',
}

print('Yes' if grp_dict[x] == grp_dict[y] else 'No')

Solution (Python):
x,y = [int(i) for i in input().split()]
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
else:
  print('No')

Solution (Python):
x,y=map(int,input().split())
if ((x in [1,3,5,7,8,10,12])&(y in [1,3,5,7,8,10,12]))|((x in [4,6,9,11])&(y in [4,6,9,11]))|((x==2)&(y==2)):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y = I()
if (x in a and y in a) or (x in b and y in b) or x == y == 2:
    print('Yes')
else:
    print('No')

Solution (Python):
x, y = map(int, input().split())
b = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

if b[x]==b[y]:
    print('Yes')
else:
    print('No')

Solution (Python):
x,y = (int(x) for x in input().split())
l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9,11]
l3 = [2]
n = 0
if x in l1:
  if y in l1:
    print ('Yes')
    n = 1
elif x in l2:
  if y in l2:
    print ('Yes')
    n = 1
else:
  if y in l3:
    print ('Yes')
    n = 1
if n == 0:
  print ('No')

Solution (Python):
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
count=0
if x in a:
    if y in a:
        count+=1
    else:
        count+=0
if x not in a and x!=2:
    if y not in a and y!=2:
        count+=1
    else:
        count+=0
if x==2:
    if y==2:
        count+=1
    else:
        count+=0
if count!=0:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b = [1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11]
x, y = map(int, input().split())
if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
elif x == y:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
input = sys.stdin.readline

x,y = list(map(int,input().split()))
nl = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
nd = {1:0,1:0,3:0,5:0,7:0,8:0,10:0,12:0,4:1,6:1,9:1,11:1,2:2}
print('Yes' if y in nl[nd[x]] else 'No')

Solution (Python):
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]


x,y=map(int,input().split())
if x in a and y in a:
    print("Yes")
    exit()
if x in b and y in b:
    print("Yes")
    exit()
print("No")

Solution (Python):
x , y = map(int,input().split())
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]
if x in A and y in A:
  print("Yes")
elif  x in B and y in B:
  print("Yes")  
else:
  print("No")

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

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]


if ((x in a) and (y in a)) or ((x in b) and (y in b)) or ((x in c) and (y in c)):
    print("Yes")
else:
    print("No")

Solution (Python):
a,b = map(int,input().split())
list1 = [1,3,5,7,8,10,12]
list2 = [4,6,9,11]
list3 = [2]

if list1.count(a) == 1:
    if list1.count(b) == 1:
        print("Yes")
    else:
        print("No")
if list2.count(a) == 1:
    if list2.count(b) == 1:
        print("Yes")
    else:
        print("No")
if list3.count(a) == 1:
    if list3.count(b) == 1:
        print("Yes")
    else:
        print("No")

Solution (Python):
x,y=map(int,input().split())
a=[4, 6, 9, 11]
if x==2 and y==2:
    print('Yes')
else:
    if (x==2 and y!=2) or (x!=2 and y==2):
        print('No')
    elif x in a and y in a:
        print('Yes')
    elif not x in a and not y in a:
        print('Yes')
    else:
        print('No')

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
if a in [4, 6, 9, 11] and b in [4, 6, 9, 11] or a in [1, 3, 5, 7, 8, 10, 12] and b in [1, 3, 5, 7, 8, 10, 12]:
  print('Yes')
else:
  print('No')

Solution (Python):
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
x, y = map(int, input().split())
if a.count(x) == 1 and a.count(y) == 1:
  print('Yes')
  exit()
elif b.count(x) == 1 and b.count(y) == 1:
  print('Yes')
  exit()
elif c.count(x) == 1 and c.count(y) == 1:
  print('Yes')
  exit()
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())
def grp(z):
  if z in [1,3,5,7,8,10,12]:
    return 'a'
  elif z in [4,6,9,11]:
    return 'b'
  elif z == 2:
    return 'c'
print('Yes' if grp(x) == grp(y) else 'No')

Solution (Python):
x, y = map(int, input().split())
g = [set([1, 3, 5, 7, 8, 10, 12]), set([4, 6, 9, 11]), set([2])]
for s in g:
    if x in s and y in s:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
L = [[1, 3, 5, 7, 8, 10, 12],[4, 6, 9, 11],[2]]
x, y = map(int,input().split())
ans = False
for i in range(len(L)):
  if x in L[i] and y in L[i]:
    ans = True
if ans:
  print("Yes")
else:
  print("No")

Solution (Python):
x,y = map(int,input().split())

A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]
ans = 'No'
if (x in A) and (y in A):
  ans ='Yes'
elif (x in B) and (y in B):
  ans ='Yes'
elif (x in C) and (y in C):
  ans ='Yes'
  
print(ans)

Solution (Python):
x, y = map(int, input().split())

A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]
C = [2]
a = 0
if x in A and y in A:
    a = 1
else:
    if x in B and y in B:
        a = 1
    else:
        if x in C and y in C:
            a = 1

if a == 1:
    print("Yes")
else:
    print("No")

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

Solution (Python):
x,y = map(int,input().split())


a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]


if (x in a) & (y in a):
  print("Yes")
elif (x in b) & (y in b):
  print("Yes")
elif (x in c) & (y in c):
  print("Yes")
else:
  print("No")

Solution (Python):
x1, x2 = map(int, input().split())
 
l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9,11]
l3 = [2]
 
if (x1 in l1) & (x2 in l1):
  print("Yes")
elif (x1 in l2) & (x2 in l2):
  print("Yes")
elif (x1 in l3) & (x2 in l3):
  print("Yes")
else:
  print("No")

Solution (Python):
from sys import exit
x,y=input().split(' ')
groups=[['1','3','5','7','8','10','12'],['4','6','9','11'],['2']]
for group in groups:
  if x in group and y in group:
    print('Yes')
    exit(0)
print('No')

Solution (Python):
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9 ,11]
c = [2]

if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')

Solution (Python):
x,y = map(int, input().split())
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

if x in A and y in A:
    print("Yes")
elif x in B and y in B:
    print("Yes")
elif x in C and y in C:
    print("Yes")
else:
    print("No")

Solution (Python):
group = [0] * 13
for i in [1, 3, 5, 7, 8, 10, 12]:
	group[i] = 1
for i in [4, 6, 9, 11]:
	group[i] = 2
group[2] = 3
x, y = map(int, input().split())
print("Yes" if group[x] == group[y] else "No")

Solution (Python):
x,y = map(int,input().split())
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]
chk = [0]*13
for a in A:
  chk[a] = 1
for a in B:
  chk[a] = 2
for a in C:
  chk[a] = 3
if chk[x]==chk[y]:
  print("Yes")
else:
  print("No")

Solution (Python):
m = dict()
a0 = [1,3,5,7,8,10,12]
a1 = [4,6,9,11]
a2 = [2]

for i,j in enumerate([a0,a1,a2]):
    for k in j:
        m[k] = i

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

if m[a] == m[b]:
    print("Yes")
else:
    print("No")

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

Solution (Python):
x,y=map(int, input().split())
group_a=[1,3,5,7,8,10,12]
group_b=[4,6,9,11]
group_c=[2]

if x in group_a and y in group_a:
  print("Yes")
elif x in group_b and y in group_b:
  print("Yes")
elif x in group_c and y in group_c:
  print("Yes")
else:
  print("No")

Solution (Python):
x, y = map(int, input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
elif x in c and y in c :
  print('Yes')
else:
  print('No')

Solution (Python):
x,y=map(int,input().split())
A=(1,3,5,7,8,10,12)
B=(4,6,9,11)
print('Yes' if (x in A and y in A) or (x in B and y in B) else 'No')

Solution (Python):
print('YNeos'['2'in input()::2])

Solution (Python):
d={s:1 for s in [4,6,9,11]}
for i in [1,3,5,7,8,10,12]:
    d[i]=0
d[2]=2
a,s=map(int,input().split())
print("Yes")if d[a]==d[s] else print("No")

Solution (Python):
li = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y = map(int,input().split())
for i in range(3):
    if x in li[i]:
        a = i
for i in range(3):
    if y in li[i]:
        b = i
if a == b:
    print("Yes")
else:
    print("No")

Solution (Python):
li = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y = map(int,input().split())
for i in range(3):
    if x in li[i]:
        a = i
for i in range(3):
    if y in li[i]:
        b = i
if a == b:
    print("Yes")
else:
    print("No")

Solution (Python):
l1=[1,3,5,7,8,10,12]
l2=[4,6,9,11]
l3=[2]
l=list(map(int,input().split()))
r1=[x for x in l if x in l1]
r2=[x for x in l if x in l2]
r3=[x for x in l if x in l3]
print("Yes" if max(len(r1),len(r2),len(r3))==2 else "No")

Solution (Python):
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]

def hantei(x):
  if x in a:
    return 1
  elif x in b:
    return 2
  else:
    return 3

x,y=map(int,input().split())
print("Yes" if hantei(x)==hantei(y) else "No")

Solution (Python):
x , y = map(int,input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
l = [a,b,c]
answer = "No"
for i in l:
  if x in i and y in i:
    answer = "Yes"
print(answer)

Solution (Python):
x, y = map(int, input().split())

if x in [1, 3, 5, 7, 8, 10, 12]:
    x_j = 1

elif x in [2]:
    x_j = 2

elif x in [4, 6, 9, 11]:
    x_j = 3

if y in [1, 3, 5, 7, 8, 10, 12]:
    y_j = 1

elif y in [2]:
    y_j = 2

elif y in [4, 6, 9, 11]:
    y_j = 3

if (x_j == y_j):
    print("Yes")

else:
    print("No")

Solution (Python):
import sys
x,y = map(int,input().split())

if x <= 0 or x >= 13 or y <= 0 or y >= 13:
    sys.exit()
if x >= y:
    sys.exit()

A = (1, 3, 5, 7, 8, 10, 12)
B = (4, 6, 9, 11)

if x == 2 or y == 2:
    print("No")
    sys.exit()
if x in A and y in A:
    print("Yes")
elif x in B and y in B:
    print("Yes")
else:
    print("No")

Solution (Python):
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    x, y = map(int, input().split())

    A = [1,3,5,7,8,10,12]
    B = [4,6,9,11]
    C = [2]

    if x in A and y in A:
        print('Yes')
    elif x in B and y in B:
        print('Yes')
    elif x in C and y in C:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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

Solution (Python):


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

g= {1:'g1', 2:'g3', 3:'g1', 4:'g2', 5:'g1', 6:'g2', 7:'g1', 8:'g1', 9:'g2', 10:'g1', 11:'g2', 12:'g1'}

if g[x] == g[y]:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    A = {1, 3, 5, 7, 8, 10, 12}
    B = {4, 6, 9, 11}
    C = {2}
    xy = set(map(int, input().split()))
    if xy <= A or xy <= B or xy <= C:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Solution (Python):
def actual(x, y):
    group1 = {1, 3, 5, 7, 8, 10, 12}
    group2 = {4, 6, 9, 11}
    group3 = {2}

    for group in [group1, group2, group3]:
        if x in group and y in group:
            return 'Yes'

    return 'No'

x, y = map(int, input().split())
print(actual(x, y))

Solution (Python):
x,y = map(int,input().split())
A = (1,3,5,7,8,10,12)
B = (4,6,9,11)

print('Yes' if (x in A and y in A) or (x in B and y in B) else 'No')

Solution (Python):
def main():
    x, y = map(int, input().split())
    a = [1, 3, 5, 7, 8, 10, 12]
    b = [4, 6, 9, 11]
    if x == 2 or y == 2:
        print('No')
    elif (x in a and y in a) or (x in b and y in b):
        print('Yes')
    else:
        print('No')
main()

Solution (Python):
x,y = map(int,input().split())

g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]

if (x in g1 and y in g1) or (x in g2 and y in g2):
    print ("Yes")
else:
    print ("No")

Solution (Python):
x,y = map(int,input().split())
ans = 'No'

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if(x in a and y in a or 
x in b and y in b or
x in c and y in c):
    ans = 'Yes'

print(ans)

Solution (Python):
x, y = (int(i) for i in input().split())

a = (1, 3, 5, 7, 8, 10, 12)
b = (4, 6, 9, 11)
c = (2,)

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x == y == 2:
    print("Yes")
else:
    print("No")

Solution (Python):
print(["Yes","No"][input().count("2")])

Solution (Python):
sequence = ((1, 3, 5, 7, 8, 10, 12), (4, 6, 9, 11), (2, ))

x , y = map(int, input().split())
for s in sequence:
    if x in s and y in s:
        print('Yes')
        exit()
print('No')

Solution (Python):
print(' YNeos'[len(set([2 if i==2 else 1 if i in [4,6,9,11] else 0 for i in list(map(int,input().split()))]))::2])

Solution (Python):
print(' YNeos'[len(set([2 if i==2 else 1 if i in[4,6,9,11] else 0 for i in list(map(int,input().split()))]))::2])

Solution (Python):
print(' YNeos'[len(set([2 if i in [2] else 1 if i in [4,6,9,11] else 0 for i in list(map(int,input().split()))]))::2])

Solution (Python):
x,y=map(int,input().split());print(' YNeos'[len(set([2 if i in [2] else 1 if i in [4,6,9,11] else 0 for i in [x,y]]))::2])

Solution (Python):
groups = [{1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}]
x, y = map(int, input().split())
flag = False
for group in groups:
    if x in group and y in group:
        flag = True
print('Yes' if flag else 'No')

Solution (Python):
x, y = map(int, input().split())

A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]

if x in A:
    x = "A"
elif x in B:
    x = "B"
else:
    x = "C"

if y in A:
    y = "A"
elif y in B:
    y = "B"
else:
    y = "C"

if x == y:
    print("Yes")
else:
    print("No")

Solution (Python):
x,y=map(int,input().split())
l=[0,
   1,
   3,
   1,
   2,
   1,
   2,
   1,
   1,
   2,
   1,
   2,
   1]

if l[x]==l[y]:
  print("Yes")
else:
  print("No")

Solution (Python):
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]

if x==y:
  print("Yes")
else:
  if (x in a and y in a) or (y in b and x in b):
    print("Yes")
  else:
    print("No")

Solution (Python):
x,y = map(int,input().split())


a =[1,3,5,7,8,10,12]
b = [4, 6,9,11]
c = [2]

if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
elif x in c and y in c:
    print('Yes')
else:
    print('No')

Solution (Python):


LI = lambda: list(map(int, input().split()))


x, y = LI()


def group(num):
    if num == 2:
        return 0
    if num in {4, 6, 9, 11}:
        return 1
    return 2


def main():
    if group(x) == group(y):
        ans = "Yes"
    else:
        ans = "No"
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

x,y= map(int, input().split())
if (x in A and y in A) or (x in B and y in B):
    print("Yes")
else:
    print("No")

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

Solution (Python):
x, y = map(int, input().split())

dic = {'A': [1, 3, 5, 7, 8, 10, 12], 'B': [4, 6, 9, 11], 'C': [2]}

gx = 0
gy = 0
for key, value in dic.items():
    if x in value:
        gx = key
    if y in value:
        gy = key
ans = 'Yes' if gx == gy else 'No'
print(ans)

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

Solution (Python):
g1 = [4,6,9,11]
g2 = [2]
g3 = [1,3,5,7,8,10,12]

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

if x in g1 and y in g1:
    print("Yes")
    exit()

if x == y == 2:
    print("Yes")
    exit()

if x in g3 and y in g3:
    print("Yes")
    exit()

print("No")

Solution (Python):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
x,y = map(int,input().split())
if x == 2 or y == 2:
  print("No")
elif x in A and y in A:
  print("Yes")
elif x in B and y in B:
  print("Yes")
else:
  print("No")

Solution (Python):
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
x,y=map(int,input().split())
print('NYoe s'[(x in a and y in a) or (y in b and y in b)::2] if x!=2 and y!=2 else 'No')

Solution (Python):
x,y=map(int,input().split())
a={1,3,5,7,8,10,12}
b={4,6,9,11}
c={2}
if x in a:
  group_x=0
elif x in b:
  group_x=1
else:
  group_x=2

if y in a:
  group_y=0
elif y in b:
  group_y=1
else:
  group_y=2

if group_x==group_y:
  print("Yes")
else:
  print("No")

Solution (Python):
x, y = map(int, input().split())

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if (x in a and y in a) or (x in b and y in b) or (x == y == 2):
    print('Yes')
    exit()
print('No')

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
if (x in a and y in a) or(x in b and y in b) or(x in c and y in c):
    print('Yes')
else:
    print('No')

Solution (Python):
nums = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] 
x, y = map(int, input().split())
if nums[x - 1] == nums[y - 1] :
  print("Yes")
else :
  print("No")

Solution (Python):
x,y=map(int,input().split())
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
C=[2]

if x in A and y in A:
    print("Yes")
    exit()
elif x in B and y in B:
    print("Yes")
    exit()
elif x in C and y in C:
    print("Yes")
    exit()
print("No")

Solution (Python):
list_a = [1, 3, 5, 7, 8, 10, 12]
list_b = [4, 6, 9, 11]
list_c = [2]

x, y = map(int, input().split())
if (x in list_a and y in list_a) or (x in list_b and y in list_b) or (x in list_c and y in list_c):
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
if (x in a and y in a) or (x in b and y in b):
    print('Yes')
else:
    print('No')

Solution (Python):
x,y = map(int,input().split())
ok = False
if x == 4 or x == 6 or x == 9 or x == 11:
    if y == 4 or y == 6 or y == 9 or y == 11: ok = True
elif x == 1 or x == 3 or x == 5 or x == 7 or x == 8 or x == 10 or x == 12:
    if y == 1 or y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12: ok = True
if ok: print('Yes')
else: print('No')

Solution (Python):
x,y=map(int,input().split())
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]

if (x in A and y in A) or (x in B and y in B) or x==y==2:
  print("Yes")
else:
  print("No")

Solution (Python):
def resolve():
    x, y = map(int, input().split())

    g1 = [1, 3, 5, 7, 8, 10, 12]
    g2 = [4, 6, 9, 11]
    g3 = 2

    ans = str()
    if x in g1 and y in g1:
        ans = "Yes"
    elif x in g2 and y in g2:
        ans = "Yes"
    elif x == g3 and y == g3:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)
resolve()

Solution (Python):
x,y = map(int, input().split())
a = [4,6,9,11]
if (x==2 or y==2):
    print("No")
    exit()
elif (x in a):
    if (y in a):
        print("Yes")
    else:
        print("No")
else:
    if (y in a):
        print("No")
    else:
        print("Yes")

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

Solution (Python):
a1 = [1,3,5,7,8,10,12]
a2 = [4,6,9,11]
a3 = [2]

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

if x in a1:
  _x = 0
elif x in a2:
  _x = 1
else:
  _x = 2
  
if y in a1:
  _y = 0
elif y in a2:
  _y = 1
else:
  _y = 2
  
if _x == _y:
  print("Yes")
else:
  print("No")

Solution (Python):
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]
result = 'No'
x, y = map(int, input().split())

if x in g1:
    if y in g1:
        result = 'Yes'
elif x in g2:
    if y in g2:
        result ='Yes'
print(result)

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

Solution (Python):
x,y = map(int, input().split())

A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

if (x in A and y in A) or (x in B and y in B) or (x in C and y in C):
  print("Yes")
else:
  print("No")

Solution (Python):
x,y = map(int, input().split())

A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

if x in A and y in A :
  print("Yes")
elif x in B and y in B :
  print("Yes")
elif x in C and y in C :
  print("Yes")
else :
  print("No")

Solution (Python):
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]
x,y = map(int, input().split())
print('Yes' if (x in g1 and y in g1) or (x in g2 and y in g2) or (x in g3 and y in g3) else 'No')

Solution (Python):
x, y = map(int, input().split())
a = set([1, 3, 5, 7, 8, 10, 12])
b = set([4, 6, 9, 11])
c = set([2])

if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())










a = [0,1,3,1,2,1,2,1,1,2,1,2,1]
if a[x] == a[y]:
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if (x in a and  y in a) or (x in b and y in b) or (x in c and y in c):
  print('Yes')
else:
  print('No')

Solution (Python):
x,y=map(int,input().split())

a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]

x_group=''
y_group=''

for i in range(len(a)):
  if x==a[i]:
    x_group='a'
  if y==a[i]:
    y_group='a'
    
for i in range(len(b)):
  if x==b[i]:
    x_group='b'
  if y==b[i]:
    y_group='b'

for i in range(len(c)):
  if x==c[i]:
    x_group='c'
  if y==c[i]:
    y_group='c'
    
if x_group==y_group:
  print('Yes')
else:
  print('No')

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

Solution (Python):
x,y = map(int,input().split())
d = {1:"a", 2:"c", 3:"a", 4:"b", 5:"a", 6:"b", 7:"a", 8:"a", 9:"b", 10:"a", 11:"b", 12:"a"}

if d[x]==d[y]:
  print("Yes")
else:
  print("No")

Solution (Python):
x,y=input().split()
l=['1','3','5','7','8','10','12','4','6','9','11','2']
x_loc=l.index(x)
y_loc=l.index(y)

if x_loc==11 and y_loc==11:
    print('Yes')
elif x_loc<7 and y_loc<7:
    print('Yes')
elif x_loc>6 and x_loc<11 and y_loc>6 and y_loc<11:
    print('Yes')
else:
    print('No')

Solution (Python):
x,y = map(int, input().split())
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
if (x in A and y in A) or (x in B and y in B):
  print('Yes')
else:
  print('No')

Solution (Python):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

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

if (x in A and y in A) or (x in B and y in B) or (x in C and y in C):
	print('Yes')
else:
	print('No')

Solution (Python):
x,y = input().split()
a = ['1','3','5','7','8','10','12']
b = ['4','6','9','11']

if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
elif x == '2' and y == '2':
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
gp_a = [1,3,5,7,8,10,12]
gp_b = [4,6,9,11]

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

if x == 2 or y == 2:
  print("No")
  sys.exit()
if (x in gp_a) and (y in gp_a):
  print("Yes")
elif (x in gp_b) and (y in gp_b):
  print("Yes")
else:
  print("No")

Solution (Python):
x, y = map(int, input().split())
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]

if ((x in g1) and (y in g1)) or ((x in g2) and (y in g2)):
  print('Yes')
else:
  print('No')