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

Solution (Python):
x,y = map(int,input().split())
if 2 in [x,y]:
  print('No')
elif (x in [4,6,9,11] and y in [4,6,9,11]) or (x not in [4,6,9,11] and y not in [4,6,9,11]):
  print('Yes')
else:
  print('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}
print("Yes" if d[x] == d[y] else "No")

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

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

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}
print("Yes" if d[x] == d[y] else "No")

Solution (Python):
s='0131212112121'
x,y=map(int,input().split())
print("Yes" if s[x]==s[y] else "No")

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

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

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

Solution (Python):
def test():
    g1 = [1,3,5,7,8,10,12]
    g2 = [4,6,9,11]
    g3 = [2]
    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")
    elif x == 2 and y == 2:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    test()

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 or x==2 and y==2 else "No")

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

def get_group(num):
  for (i, g) in enumerate(GROUPS):
    if num in g:
      return i
  return -1

(x, y) = (int(tok) for tok in input().split())
print("Yes" if get_group(x) == get_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]
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}
print('Yes' if {x,y}<=a or {x,y}<=b else 'No')

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

Solution (Python):

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

Solution (Python):
import sys
 
X, Y=map(int,input().split())
 
if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 or Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()

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

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

arr = [1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1 ]

if arr[x-1] == arr[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 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 = [int(i) for i in input().split()]

groupa = [1,3,5,7,8,10,12]
groupb = [4,6,9,11]

if (x in groupa) and (y in groupa):
  print("Yes")
elif x in groupb and y in groupb:
  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:
    if y in a:
        print("Yes")
    else:
        print("No")
elif x in b:
    if y in b:
        print("Yes")
    else:
        print("No")
else:
    if 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]
x,y = map(int, input().split())
if x in g1 and y in g1 or x in g2 and y in g2:
    ans = 'Yes'
else:
    ans ='No'
print(ans)

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

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):
S="_ACABABAABABA"
a,b=map(int,input().split())
print("Yes" if S[a]==S[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, )
 
for g in (a, b, c):
  if x in g and y in g:
    print('Yes')
    break
else:
  print('No')

Solution (Python):
group = [0,1,3,1,2,1,2,1,1,2,1,2,1]

x,y = map(int,input().split())
if group[x] == group[y]:
  print("Yes")
else:
  print("No")

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

if x==2 or y==2:
    print('No')
elif x==4 or x==6 or x==9 or x==11:
    if y==4 or y==6 or y==9 or y==11:
        print('Yes')
    else:
        print('No')
else:
    if y == 4 or y == 6 or y == 9 or y == 11:
        print('No')
    else:
        print('Yes')

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

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

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 = input().split()
a1 = [1 , 3 , 5 , 7 , 8 , 10 , 12]
b1 = [4 , 6 , 9 , 11]
c1 = [2]
x = int(x)
y = int(y)
b = False
if x in a1:
    if y in a1:
        b = True
if x in b1:
    if y in b1:
        b = True
if x in c1:
    if y in c1:
        b = True

if b:
    print("Yes")
else:
    print("No")

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

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
INF = float("inf")


def yes():
    print("Yes")  


def no():
    print("No")  


def solve(x: int, y: int):
    table = [0]*13
    table[2] = 2
    table[4] = 1
    table[6] = 1
    table[9] = 1
    table[11] = 1
    if table[x] == table[y]:
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    x = int(next(tokens))  
    y = int(next(tokens))  
    solve(x, y)


if __name__ == '__main__':
    main()

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
import random
 




 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    x,y = inputMap()
    
    UF = UnionFind(13)
    
    UF.union(1,3)
    UF.union(1,5)
    UF.union(1,7)
    UF.union(1,8)
    UF.union(1,10)
    UF.union(1,12)
    
    UF.union(4,6)
    UF.union(4,9)
    UF.union(4,11)
    
    tmp = UF.is_same(x,y)
    if tmp == True:
        print("Yes")
    else:
        print("No")
    
    
class UnionFind(object):
	def __init__(self, n=1):
		self.par = [i for i in range(n)]
		self.rank = [0 for _ in range(n)]
		self.size = [1 for _ in range(n)]
		
	
	def find(self, x):
		if self.par[x] == x:
			return x
		else:
			self.par[x] = self.find(self.par[x])
			return self.par[x]
		
	
	def union(self, x, y):
		x = self.find(x)
		y = self.find(y)
		if x != y:
			
			sum = self.size[x] + self.size[y]
			self.size[x] = sum
			self.size[y] = sum
			
			if self.rank[x] < self.rank[y]:
				x, y = y, x
			if self.rank[x] == self.rank[y]:
				self.rank[x] += 1
			self.par[y] = x
	
	
	def is_same(self, x, y):
		return self.find(x) == self.find(y)
		
	
	def getSize(self, x):
		par_x = self.find(x)
		return self.size[par_x]
	
if __name__ == "__main__":
	main()

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

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

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

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

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

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

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

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

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

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

Solution (Python):


x, y = input().rstrip().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]
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:
  if y in a:
    print("Yes")
  else:
    print("No")
if x in b:
  if y in b:
    print("Yes")
  else:
    print("No")
if x in c:
  if y in c:
    print("Yes")
  else:
    print("No")

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

x,y = [int(i) for i in input().split()]
res = True
for cond in conds:
    if (x in cond)!=(y in cond):
        res=False
print("Yes" if res else "No")

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

def get_group(x):
    if x in a:
        return 'a'
    if x in b:
        return 'b'
    if x in c:
        return 'c'

if get_group(x) == get_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]
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())
group = {1:1, 3:1, 5:1, 7:1, 8:1, 10:1, 12:1, 4:2, 6:2, 9:2, 11:2, 2:3}
print("Yes" if group[x] == group[y] else "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):
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
d, e = map(int, input().split())
if (d in a and e in a) or (d in b and e in b) or (d in c and e in c):
    print("Yes")
else:
    print("No")

Solution (Python):
x,y=[int(x) for x in input().split()]
g=[[1,3,5,7,8,10,12],[4,6,9,11],[2]]
for G in g:
  if x in G and y in G:
    print('Yes')
    break
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):
a = [-1,0,1,0,2,0,2,0,0,2,0,2,0]
x,y  = map(int,input().split())
if a[x] == a[y]:
    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]

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

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

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

if len(a & s)==2 or len(b & s)==2 or len(c & s)==2:
  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())
for group in (A,B,C):
  if x in group and y in group:
    print('Yes')
    exit()
print('No')

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

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

Solution (Python):

g = " ACABABAABABA"
x, y = map(int, input().split())
print("Yes" if g[x] == g[y] else "No")

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

g_1=[1,3,5,7,8,10,12]
g_2=[4,6,9,11]
g_3=[2]

if x in g_1:
    if y in g_1:
        print("Yes")
    else:
        print("No")
if x in g_2:
    if y in g_2:
        print("Yes")
    else:
        print("No")
if x in g_3:
    if y in g_3:
        print("Yes")
    else:
        print("No")

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

if a[x] == a[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:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

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


X =  (1, 3, 5, 7, 8, 10, 12)
Y =  (4, 6, 9, 11 )

if x in X and y in X:
    print('Yes')

elif x in Y and y in 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, )

for g in (a, b, c):
  if x in g and y in g:
    print('Yes')
    break
else:
  print('No')

Solution (Python):
x,y = map(int,input().split())
gr1 = [2]
gr2 = [4,6,9,11]
if x in gr1:
  x_gr = 1
elif x in gr2:
  x_gr = 2
else:
  x_gr = 3
if y in gr1:
  y_gr = 1
elif y in gr2:
  y_gr = 2
else:
  y_gr = 3
if x_gr == y_gr:
  print('Yes')
else:
  print('No')

Solution (Python):
x,y = map(int,input().split())
i = [1,3,5,7,8,10,12]
j = [4,6,9,11]
k = [2]
if x in i and y in i:
    print('Yes')
elif x in j and y in j:
    print('Yes')
elif x in k and y in k:
    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())
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):
one = [1,3,5,7,8,10,12]
two = [2]
three = [4,6,9,11]
kazu = list(map(int, input().split()))
iti = 0
ni = 0
san = 0
for k in kazu:
  if k in one:
    iti += 1
  elif k in two:
    ni += 1
  elif k in three:
    san += 1
if iti == 2 or ni == 2 or san == 2:
  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 y in b and x in b:
    print('Yes')
else:
    print('No')

Solution (Python):
def judge(x):
  if x==4 or x==6 or x==9 or x==11:
    y = 'a'
  elif x==2:
    y = 'b'
  else:
    y = 'c'
  return y
 
a,b = map(int,input().split())
if judge(a) == judge(b) :
  print('Yes')
else:
  print('No')

Solution (Python):
s='0121313113131'
x,y=map(int,input().split())
print('YNeos'[s[x]!=s[y]::2])

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

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

for g in G:
    if x in g and y in g:
        print("Yes")
        exit()
print("No")

Solution (Python):
x, y = map(int, input().split())
a = [4, 6, 9, 11]
if (x == 2) | (y == 2) : print('No')
elif (x in a) & (y in a) : print('Yes')
elif (x in a) | (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]
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())

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) or (x in group_b and y in group_b):
    print('Yes')
else:
    print('No')

Solution (Python):



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


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


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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
a = [1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
x, y = MAP()
if a[x - 1] == a[y - 1]:
    print("Yes")
else:
    print("No")

Solution (Python):
s='0121313113131'
x,y=map(int,input().split())
print('YNeos'[s[x]!=s[y]::2])

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

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

flag = False
for g in [A, B, C]:
  if (x in g and y in g):
    flag = True
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
def main():
    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')


main()

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

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

alist = [1, 3, 5, 7, 8, 10, 12]
blist = [4, 6, 9, 11]
clist = [2]

xg = ''
yg = ''

for i in alist:
    if i == x:
        xg = 'A'

    if i == y:
        yg = 'A'

for i in blist:
    if i == x:
        xg = 'B'

    if i == y:
        yg = 'B'

for i in clist:
    if i == x:
        xg = 'C'

    if i == y:
        yg = 'C'

if xg == yg:
    print('Yes')
else:
    print('No')

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    x, y = LI()
    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")
        return
    if x in b and y in b:
        print("Yes")
        return
    if x in c and y in c:
        print("Yes")
        return
    print("No")
    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

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 in a and y in a) or (x in b and y in b) or (x == 2 and y == 2):
  print('Yes')
else:
  print('No')

Solution (Python):

def main():
    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')

if __name__ == '__main__':
    main()

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")
elif(x==y==2):
    print("Yes")
else:
    print("No")

Solution (Python):
x,y=map(int,input().split())
l=[1,3,5,7,8,10,12]
m=[4,6,9,11]
n=[2]
if x in l:
    if y in l:
        print("Yes")
        import sys
        sys.exit()
if x in m:
    if y in m:
        print("Yes")
        import sys
        sys.exit()
print("No")

Solution (Python):
a, b = 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")

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):
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]

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())
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=[4,6,9,11]
b=[1,3,5,7,8,10,12]
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=[4,6,9,11]
b=[1,3,5,7,8,10,12]
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())
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):
x, y = map(int,input().split())





ls = [4,6,9,11]

if (ls.count(x) == 1 and ls.count(y) == 1) or (x == 2 and y == 2) or (ls.count(x) != 1 and x != 2 and y != 2 and ls.count(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")
elif x in B and y in B:
    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')
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]

if x in A and y in A:
    print('Yes')
    exit()
if x in B and y in B:
    print('Yes')
    exit()
if x in C and y in C:
    print('Yes')
    exit()

print('No')

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

if (x in lst1 and y in lst1) or (x in lst2 and y in lst2) or (x in lst3 and y in lst3):
    print('Yes')
else:
    print('No')

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