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):
def iroha():
    a, b = map(int, input().split())

    if a == 2 or b == 2:
        print("No")
        return

    list = [4, 6, 9, 11]
    count = 0
    
    for x in list:
        if a == x or b == x:
            count += 1

    if count == 1:
        print("No")
        return
        
    print("Yes")


if __name__ == "__main__":
    iroha()

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):
x, y=map(int, input().split())
A=set([1, 3, 5, 7, 8, 10, 12])
B=set([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())
S1 = [1, 3, 5, 7, 8, 10, 12]
S2 = [4, 6, 9, 11]
ans = False
for i in range(len(S1)):
  for j in range(len(S1)):
    if S1[i] == x and S1[j] == y:
      ans = True
for i in range(len(S2)):
  for j in range(len(S2)):
    if S2[i] == x and S2[j] == y:
      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]
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 == 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())

ga = [4,6,9,11]
gb = [1,3,5,7,8,10,12]
gc = [2]

xg = yg = ""
def group(x):
  if x in ga:
    return "ga"
  if x in gb:
    return "gb"
  if x in gc:
    return "gc"
xg = group(x)
yg = group(y)
if xg == yg:
  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):
array1 = [1,3,5,7,8,10,12]
array2 = [4,6,9,11]
array3 = [2]
x,y = map(int,input().split())
if (x in array1 and y in array1) or (x in array2 and y in array2) or (x in array3 and y in array3):
  print("Yes")
else:
  print("No")

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

s = [1,3,5,7,8,10,12]
s1 = [4,6,9,11]
s2 = [2]

if x in s:
    if y in s:
        print('Yes')
        exit()
elif x in s1:
    if y in s1:
        print('Yes')
        exit()
elif x in s2:
    if y in s2:
        print('Yes')
        exit()

print('No')

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

n=[0,1,3,1,2,1,2,1,1,2,1,2,1]

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

Solution (Python):
lisa=[1,3,5,7,8,10,12]
lisb=[4,6,9,11]
lisc=[2]
x,y=map(int,input().split())
if (x in lisa)and(y in lisa):
    print("Yes")
elif (x in lisb)and(y in lisb):
    print("Yes")
elif (x in lisc)and(y in lisc):
    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]
if x in group_A and y in group_A :
  print("Yes")
elif x in group_B and y in group_B :
  print("Yes")
else:
  print("No")

Solution (Python):
g = [-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]
x, y = map(int, input().split())
if g[x] == g[y]: 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):
lst = input().split()

x = int(lst[0])
y = int(lst[1])

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

def judge(L):
   if (x in L) and (y in L):
      return True
   else:
      return False

if judge(A) or judge(B) or judge(C):
   print('Yes')
else:
   print('No')

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

if x in gr_a and y in gr_a:
  print("Yes")
elif x in gr_b and y in gr_b:
  print("Yes")
else:
  print("No")

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

group_1 = {1, 3, 5, 7, 8, 10, 12}
group_2 = {4, 6, 9, 11}

if (x in group_1) and (y in group_1):
    print('Yes')
elif (x in group_2) and (y in group_2):
    print('Yes')
else:
    print('No')

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

Solution (Python):
data_1 =[1,3,5,7,8,10,12]
data_2 =[4,6,9,11]
x,y = map(int,input().split())
if x in data_1 and y in data_1:
    print('Yes')
elif x in data_2 and y in data_2:
    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:
  check = True
elif x in B and y in B:
  check = True
elif x in C and y in C:
  check = True
else:
  check = False
  
print("Yes" if check else "No")

Solution (Python):
l = ((1,3,5,7,8,10,12),(4,6,9,11),(0,2))
x,y = map(int, input().split())
p = 0
for i in l:
	if x in i and y in i:
		p = 1
		break
ans = 'Yes' if p == 1 else 'No'
print(ans)

Solution (Python):

def main():
    x, y = map(int, input().split())
    g_a = [1, 3 , 5, 7, 8, 10, 12]
    g_b = [4, 6, 9, 11]
    g_c = [2]

    if x in g_a and y in g_a:
        print('Yes')
    elif x in g_b and y in g_b:
        print('Yes')
    elif x in g_c and y in g_c:
        print('Yes')
    else:
        print('No')

if __name__ ==  "__main__":
    main()

Solution (Python):
x,y=map(int,input().split())
A={1,3,5,7,8,10,13}
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]
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())
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):
a,b=map(int,input().split())
s=[1,3,5,7,8,10,12]
t=[4,6,9,11]
if a in s:
    a = 0
elif a in t:
    a = 1
else:
    a = 2
if b in s:
    b = 0
elif b in t:
    b = 1
else:
    b = 2
print("Yes" if a==b else "No")

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

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

x, y = input().split()

for i in range(0, 7):
    if int(x) == a[i] or int(y) == a[i]:
        acount += 1

for i in range(0, 4):
    if int(x) == b[i] or int(y) == b[i]:
        bcount += 1

if int(x) == c[0]:
    ccount += 1
if int(y) == c[0]:
    ccount += 1


if acount == 2 or bcount == 2 or ccount == 2:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    x, y = i_map()

    if x == 2 or y == 2:
        print('No')
        exit()

    al = [1, 3, 5, 7, 8, 10, 12]
    bl = [4, 6, 9, 11]

    if x in al and y in al:
        print('Yes')
    elif x in bl and y in bl:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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

if x in G1 and y in G1:
  print('Yes')
elif x in G2 and y in G2:
  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):print('Yes')
else:print('No')

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

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


if __name__ == "__main__":
    main()

Solution (Python):
group = [0,2,0,1,0,1,0,0,1,0,1,0]
x,y = map(int, open(0).readline().split())
print('Yes' if group[x-1] == group[y-1] 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==y or (x in a and y in a) or (x in b and y in b)):
    print("Yes")
else:
    print("No")

Solution (Python):
a = map(int, input().split())
input_set = set(a)

group_a = {1, 3, 5, 7, 8, 10, 12}
group_b = {4, 6, 9, 11}
group_c = {2}

list_of_list = [group_a, group_b, group_c]

count_match = 0

for set_i in list_of_list:
    if set_i.issuperset(input_set):
        count_match += 1
        print('Yes')
        break

if not count_match >= 1:
    print('No')

Solution (Python):
a = map(int, input().split())
input_list = list(a)

group_a = [1, 3, 5, 7, 8, 10, 12]
group_b = [4, 6, 9, 11]
group_c = [2]
list_of_list = [group_a, group_b, group_c]

count_match = 0

for list_i in list_of_list:
    if input_list[0] in list_i and input_list[1] in list_i:
        count_match += 1
        break

if count_match == 1:
    print('Yes')
else:
    print('No')

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

s=list(map(int,input().split()))

for i in a:
  if s[0]==i:
    p=0
  elif s[0]==2:
    p=2
  else:
    p=1

for i in a:
  if s[1]==i:
    q=0
  elif s[1]==2:
    q=2
  else:
    q=1

if p==q:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x, y = map(int, readline().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")


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())
print("Yes" if (x in a and y in a) or (x in b and y in b) 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 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):
x, y = map(int, input().split())

gr1=[1,3,5,7,8,10,12]
gr2=[4,6,9,11]
gr3=[2]

if x in gr1 and y in gr1:
    print('Yes')
elif x in gr2 and y in gr2:
    print('Yes')
elif x in gr3 and y in gr3:
    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")
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 == 2 and y == 2:
    print("Yes")
elif x in g1 and y in g1:
    print("Yes")
elif x in g2 and y in g2:
    print("Yes")
else:
 print("No")

Solution (Python):
G = [set([1,3,5,7,8,10,12]), set([4,6,9,11]), set([2])]
def check(x, y):
  for g in G:
    if x in g and y in g:
      return True
  return False
x, y = map(int, input().split())
print("Yes" if check(x, y) else "No")

Solution (Python):
x, y = map(int, input().split())
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}
if d[x]==d[y]:
    print("Yes")
else:
    print("No")

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

Solution (Python):
L=[1,0,1,2,1,2,1,1,2,1,2,1]
a,b=map(int,input().split())
if L[a-1]==L[b-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')
elif x in B and y in B:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
a, b = map(int, input().split())
s = {1, 3, 5, 8, 7, 10, 12}
t = {4, 6, 9, 11}
u = {2}
if a in s and b in s:
    print("Yes")
elif a in t and b in t:
    print("Yes")
elif a in u and b in u:
    print("Yes")
else:
    print("No")

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

if x in grp1 and y in grp1: print("Yes")
elif x in grp2 and y in grp2: print("Yes")
else: print("No")

Solution (Python):
a, b = map(int, input().split())
s = {1, 3, 5, 8, 7, 10, 12}
t = {4, 6, 9, 11}
u = {2}
if a in s and b in s:
    print("Yes")
elif a in t and b in t:
    print("Yes")
elif a in u and b in u:
    print("Yes")
else:
    print("No")

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

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

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

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

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

flag = False
if x in group1 and y in group1:
    flag = True
elif x in group2 and y in group2:
    flag = True
    
if flag:
    print('Yes')
else:
    print('No')

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

grp1=[1,3,5,7,8,10,12]
grp2=[4,6,9,11]

if x in grp1 and y in grp1: print('Yes')
elif x in grp2 and y in grp2: print('Yes')
else: print('No')

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

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

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

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

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

Solution (Python):
a,b,c=[1,3,5,7,8,10,12],[4,6,9,11],[2]
print('YNeos'[len(set([0 if i in a else [1,2][i in b] for i in list(map(int,input().split()))]))!=1::2])

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

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

if x in l1 and y in l1:
    print('Yes')
elif x in l2 and y in l2:
    print('Yes')
elif x in l3 and y in l3:
    print('Yes')
else:
    print('No')

Solution (Python):
x=[1,3,5,7,8,10,12]
y=[4,6,9,11]
z=[2]
l,r=map(int,input().split())
if(l in x and r in x):
    print("Yes")
elif(l in y and r in y):
    print("Yes")
elif(l in z and r 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]
 
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')

Solution (Python):
x, y = map(int, input().split())
if x in [1, 3, 5, 7, 8, 10, 12] and y in [1, 3, 5, 7, 8, 10, 12]:
  print('Yes')
elif x in [4, 6, 9, 11] and y in [4, 6, 9, 11]:
  print('Yes')
elif x == 2 and y == 2:
  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==Y==2:
    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:
    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):
def solve():
    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")


if __name__ == "__main__":
    solve()

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

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

a, b = map(int, input().split())
print("Yes" if a in n1 and b in n1 or a in n2 and b in n2 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 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) 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 x not in b and x not in c and y in a and y not in b and y not in c:
  print('Yes')
elif x not in a and x in b and x not in c and y not in a and y in b and y not in c :
  print('Yes')
else:
  print('No')

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

a, b = input().split(' ')

if a in c[0] and b in c[0]:
  print("Yes")
elif a in c[1] and b in c[1]:
  print("Yes")
elif a in c[2] and b in c[2]:
  print("Yes")
else:
  print("No")

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

Solution (Python):
N = 12
Parent = [I for I in range(N+1)]
Rank = [0]*(N+1)
def FindParent(X):
    if Parent[X]==X:
        return X
    else:
        Parent[X] = FindParent(Parent[X])
        return Parent[X]

def CheckParent(X,Y):
    return FindParent(X)==FindParent(Y)

def UniteParent(X,Y):
    X = FindParent(X)
    Y = FindParent(Y)
    if X==Y:
        return 0
    if Rank[X]<Rank[Y]:
        Parent[X] = Y
    else:
        Parent[Y] = X
        if Rank[X]==Rank[Y]:
            Rank[X] += 1
            
for GA in [3,5,7,8,10,12]:
    UniteParent(1,GA)
for GB in [6,9,11]:
    UniteParent(4,GB)
X,Y = (int(T) for T in input().split())
print(['No','Yes'][CheckParent(X,Y)])

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):
f_1 = {1,3,5,7,8,10,12}
f_2 = {4,6,9,11}
 
x, y = map(int, input().split())
if (x in f_1) and (y in f_1):
  print("Yes")
elif (x in f_2) and (y in f_2):
  print("Yes")
else:
  print("No")

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    x, y = LI()
    d = {1: 0, 2: 2, 3: 0, 4: 1, 5: 0, 6: 1, 7: 0, 8: 0, 9: 1, 10: 0, 11: 1, 12: 0}

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

if __name__ == '__main__':
    resolve()

Solution (Python):
a, b = map(int, input().split())

if a == 4 or a == 6 or a == 9 or a == 11:
  if b == 1 or b == 2 or b == 3 or b == 5 or b == 7 or b == 8 or b == 10 or b == 12:
    print("No")
  else:
    print("Yes")
    
elif a == 2:
  print("No")
  
else:
  if b == 2 or b == 4 or b == 6 or b == 9 or b == 11:
    print("No")
  else:
    print("Yes")

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')
else:
    print('No')

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

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

Solution (Python):
r = list(map(int,input().split()))
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if r[0]==2 or r[0]==2:
  print('No')
elif len(list(set(r) & set(a))) == 2:
  print('Yes')
elif len(list(set(r) & set(b))) == 2:
  print('Yes')
else:
  print('No')

Solution (Python):
x, y = map(int, input().split())
a = [4, 6, 9, 11]
b = 0
c = 0
if x == 2 or y == 2:
    print("No")
else:
    if x in a:
        b = 1
    if y in a:
        c = 1
    if (b + c) % 2 == 0:
        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):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    g1 = [1,3,5,7,8,10,12]
    g2 = [4,6,9,11]
    g3 = [2]
    d = {}
    for x in g1: d[x] = 1
    for x in g2: d[x] = 2
    for x in g3: d[x] = 3
    x, y = map(int, input().split())
    if d[x] == d[y]:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

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

def group(z):
  if z in g1:return 1
  elif z in g2:return 2
  else: return 3
  
if group(x)==group(y):print('Yes')
else:print('No')

Solution (Python):
s1 =set([1,3,5,7,8,10,12])
s2 =set([4,6,9,11])
s3 =set([2])
a,b =map(int,input().split())
for i in [s1,s2,s3]:
  if a in i and b in i:
    print("Yes")
    break
else:
  print("No")

Solution (Python):
x,y=map(int,input().split())
for l in [[1,3,5,7,8,10,12],[4,6,9,11],[2]]:
    if x in l and y in l:
        print('Yes')
        exit()
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):
    print("Yes")
elif (x in g2 and y in g2):
    print("Yes")
elif (x in g3 and y in g3):
    print("Yes")
else:
    print("No")

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

Solution (Python):
x,y=map(int,input().split())
G="121313113131"
print(["No","Yes"][G[x-1]==G[y-1]])

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

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, b = map(int, input().split())

lis = [4, 6, 9, 11]
lis2 = [1, 3, 5, 7, 8, 10, 12]

if a == b == 2:
    print('Yes')
elif a in lis and b in lis:
    print('Yes')
elif a in lis2 and b in lis2:
    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]
ls = [A,B,C]
ans = 'No'
for i in range(3):
    if x in ls[i] and y in ls[i]:
        ans = 'Yes'
print(ans)

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())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
if (x == 2 or y == 2) or (x in a and y not in a) or (x in b and y not in b):
    print('No')
else:
    print('Yes')

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

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

list_1 = [1, 3, 5, 7, 8, 10, 12]
list_2 = [4, 6, 9, 11]
list_3 = [2]

if x in list_1:
  tmp = list_1
elif x in list_2:
  tmp = list_2
else:
  tmp = list_3

if y in tmp:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)

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

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

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):
a, b = list(map(int, input().split()))
x = [1, 3, 5, 7, 8, 10, 12]
y = [4, 6, 9, 11]
if a in x and b in x:
  print('Yes')
elif a in y and b in y:
  print('Yes')
elif a == 2 and b == 2:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
def hanntei(x):
  a=[1,3,5,7,8,10,12]
  b=[4,6,9,11]
  c=[2]
  if x in a:
    return "a"
  elif x in b:
    return "b"
  else:
    return "c"
x,y=map(int,input().split())
x=hanntei(x)
y=hanntei(y)
print("Yes" if x==y 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==y==2:
    print("Yes")
elif (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())
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())
if x==y==2:
    print("Yes")
elif x==4:
    if y==6 or y==9 or y==11:
        print("Yes")
    else:
        print("No")
elif x==6:
    if y==4 or y==9 or y==11:
        print("Yes")
    else:
        print("No")
elif x==9:
    if y==6 or y==4 or y==11:
        print("Yes")
    else:
        print("No")
elif x==11:
    if y==6 or y==9 or y==4:
        print("Yes")
    else:
        print("No")


else:
    if y!=2 and y!=4 and y!=6 and y!=9 and y!=11:
        print("Yes")
    else:
        print("No")

Solution (Python):
"""AtCoder."""


def get_group(n):
    if n in [1,3,5,7,8,10,12]:
        return 0
    
    if n in [4, 6, 9, 11]:
        return 1

    if n in [2]:
        return 2

def main():
    x, y = map(int, input().split())
    
    if get_group(x) == get_group(y):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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

Solution (Python):
g = [31,28,31,30,31,30,31,31,30,31,30,31]
 
tmp = input().split(" ")
print("Yes") if g[int(tmp[0]) - 1] == g[int(tmp[1]) - 1] else print("No")

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

if x == 2 and y == 2:
    print('Yes') 
elif x in f and y in f:
    print('Yes') 
elif x in g and y in g:
    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):
k = [1,3,1,2,1,2,1,1,2,1,2,1]
N,M = map(int,input().split())
if k[N-1] == k[M-1]:
  print("Yes")
else:
  print("No")

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
x, y = M()
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:
    print('Yes')
else:
    print('No')

Solution (Python):
x, y = [int(s) for s in input().split()]
temp_list = [-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]
print("Yes" if temp_list[x] == temp_list[y] else "No")

Solution (Python):
x, y = [int(s) for s in input().split()]
temp_list = [{1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 1}, {2}]
ans = "No"
for temp in temp_list:
    if x in temp and y in temp:
        ans = "Yes"
print(ans)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = [set()] * 3
    S[0] = {1, 3, 5, 7, 8, 10, 12}
    S[1] = {4, 6, 9, 11}
    S[2] = {2}

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

    ans = 'No'
    for s in S:
        if x in s and y in s:
            ans = 'Yes'
            break

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
sa=(1,3,5,7,8,10,12,)
sb=(4,6,9,11,)
sc=(2,)
l=[sa,sb,sc]

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