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

Solution (Python):

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

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

for i in range(3):
    if x in group[i]:
        x = i
        break
for i in range(3):
    if y in group[i]:
        y = i
        break

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

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

print("Yes" if g[x - 1] == g[y - 1] else "No")

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

for i in range(3):
    if x in a[i]:
        if y in a[i]:
            print("Yes")
            exit()
print("No")

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

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 c or y in c:
	print ("No")
	exit()
if (x in a and y in a) or (x in b and y in b):
	print ("Yes")
else:
	print ("No")

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

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

B = (4,6,9,11)
C = (1,3,5,7,8,10,12)
if x==y==2:
  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 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())
l1=[1,3,5,7,8,10,12]
l2=[4,6,9,11]
l3=[2]
if (x in l1 and y in l1) or (x in l2 and y in l2) or (x in l1 and y in l1) or (x in l3 and y in l3):
    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):
data = input().split(" ")
x = int(data[0])
y = int(data[1])
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
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, b, c = [1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]
x, y = map(int, input().split())
flg = 0
for lst in [a, b, c]:
    if x in lst and y in lst:
        flg = 1
if flg:
    print('Yes')
else:
    print('No')

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().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 solve():
    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



if __name__ == '__main__':
    solve()

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x,y = LI()
    f = [0,1,3,1,2,1,2,1,1,2,1,2,1]
    if f[x] == f[y]:
        print("Yes")
    else:
        print("No")
    return


if __name__ == "__main__":
    solve()

Solution (Python):
data = input().split(" ")
x = int(data[0])
y = int(data[1])
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
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):
group = [[1, 3, 5, 7, 8, 10, 12],  [4, 6, 9, 11], [2]]
x, y = map(int, input().split())
ans = "No"

for g in group:
    if x in g and y in g:
        ans = "Yes"
        break

print(ans)

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):
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
input = sys.stdin.readline
sys.setrecursionlimit(10**6)





class UnionFind:
    def __init__(self, n):
        self.tree = [i for i in range(n)]

    def root(self, x):
        if(self.tree[x] == x):
            return x
        self.tree[x] = self.root(self.tree[x])
        return self.tree[x]  

    def same(self, x, y):  
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if(x == y):
            return
        self.tree[x] = y


uf = UnionFind(12)
uf.unite(0, 2)
uf.unite(0, 4)
uf.unite(0, 6)
uf.unite(0, 7)
uf.unite(0, 9)
uf.unite(0, 11)
uf.unite(3, 5)
uf.unite(3, 8)
uf.unite(3, 10)

x, y = map(int, input().split())
print('YNeos'[not uf.same(x-1, y-1)::2])

Solution (Python):
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    atog={}
    aa=[[1,3,5,7,8,10,12],[4,6,9,11],[2]]
    for g,ga in enumerate(aa):
        for a in ga:
            atog[a]=g
    x,y=MI()
    if atog[x]==atog[y]:print("Yes")
    else:print("No")

main()

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:
    x = "A"
else:
    x = "B" if x in b else "C"
if y in a:
    y = "A"
else:
    y = "B" if y in b else "C"
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]

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

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())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if x in a:
    x_flag = 0
elif x in b:
    x_flag = 1
else:
    x_flag = 2

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

if x_flag==y_flag:
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import stdin
from itertools import accumulate

li = [1,3,5,7,8,10,12]
li2 = [4,6,9,11]
li3 = [2]

x,y = [int(x) for x in stdin.readline().rstrip().split()]

if x in li  and y in li:
    print("Yes")
elif x in li2 and y in li2:
    print("Yes")
else:
    print("No")

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

Solution (Python):
S="XACABABAABABA"
a,b=map(int,input().split())
if S[a]==S[b]:
  print("Yes")
else:
  print("No")

Solution (Python):
a = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y = map(int,input().split())
issame = False
for l in a:
  if x in l and y in l:
    issame = True
    break

print("Yes" if issame else "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:
    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())
a = [4,6,9,11]
b = [1,3,5,7,8,10,12]
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")
else:
  print("No")

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

a,b=map(int,input().split())
if a in l1 and b in l1:
  print("Yes")
elif a in l2 and b in l2:
  print("Yes")
elif a in l3 and b in l3:
  print("Yes")
else:
  print("No")

Solution (Python):


import math


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

g2 = [4,6,9,11]


if x == 2 or y == 2 :
  print ("No")
  exit()
  
if x in g2 and y in g2 :
  print ("Yes")
elif x not in g2 and y not in g2 :
  print ("Yes")
else :
  print ("No")

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

g1 = g2 = -1

for i in range(3):
    if x in l[i]:
        g1 = i
    
    if y in l[i]:
        g2 = i

print('Yes' if g1==g2 else 'No')

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

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

ls_1 = [1, 3, 5, 7, 8, 10, 12]
ls_2 = [4, 6, 9, 11]
ls_3 = [2]

if ((x in ls_1) and (y in ls_1)) or ((x in ls_2) and (y in ls_2)) or ((x in ls_3) and (y in ls_3)):
    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:
    if y in a:
        print('Yes')
    else:
        print('No')
elif x in b:
    if y in b:
        print('Yes')
    else:
        print('No')
else:
    if 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"}
print("Yes" if {x, y} <= a or {x, y} <= b else "No")

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

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
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:
    print('Yes')
elif x in g2 and y in g2:
    print('Yes')
else:
    print('No')

Solution (Python):
def f(n):
    if n == 2: return 0
    if n in [4, 6, 9, 11]: return 1
    return 2

a, b = map(int, input().split())
if f(a) == f(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 any(x == i for i in a) and any(y == i for i in a):
       print('Yes')
elif any(x == i for i in b) and any(y == i for i in b):
       print('Yes')
elif any(x == i for i in c) and any(y == i for i 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 == 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())
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())

l = [1,3,5,7,8,10,12]
k = [4,6,9,11]



a1 = l.count(x)
a2 = l.count(y)

b1 = k.count(x)
b2 = k.count(y)

if x == 2 or y == 2:
	print('No')
elif a1 == a2:
	print('Yes')
elif b1 == b2:
	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}
group3 = {2}
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):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

g = {i:'A' for i in A}
g.update({i:'B' for i in B})
g.update({i:'C' for i in C})

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

Solution (Python):
def examA():
    group1 = [1,3,5,7,8,10,12]
    group2 = [4,6,9,11]
    x,y = LI()
    ans = "No"
    if x in group1 and y in group1:
        ans = "Yes"
    elif x in group2 and y in group2:
        ans = "Yes"
    print(ans)

import sys
import copy
import bisect
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

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

Solution (Python):
num = list(map(int, input().split(' ')))
mylist = [1, 3, 5, 7, 8, 10, 12]
ans = 0
for i in num:
    if i in mylist:
        ans += 1
    elif i == 2:
        ans += 3

if ans == 0 or ans == 2:
    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:
    print("Yes")
elif 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]
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):
g = [1, 3, 5, 7, 8, 10, 12]
a, b = map(int, input().split())
if a==2 or b == 2:
  print('No')
elif a in g and b in g:
  print('Yes')
elif a not in g and b not in g:
  print('Yes')
else:
  print('No')

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

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())
list1 = [1,3,5,7,8,10,12]
list2 = [4,6,9,11]
list3 = [2]
if x in list1:
    i = 1
elif x in list2:
    i = 2
else:
    i = 3
if i == 1:
    if y in list1:
        print("Yes")
    else:
        print("No")
elif i == 2:
    if y in list2:
        print("Yes")
    else:
        print("No")
else:
    if y in list3:
        print("Yes")
    else:
        print("No")

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

Solution (Python):
s1, s2, s3 = {1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}
c = set(map(int, input().split()))
if c<=s1 or c<=s2 or c<=s3:
  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")
elif x in g3 and y in g3:
  print("Yes")
else:
  print("No")

Solution (Python):
a=set([1,3,5,7,8,10,12])
b=set([4,6,9,11])
c=set([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):
import sys
input = sys.stdin.readline
print = sys.stdout.write
x, y = [int(_) for _ in input().split()]
a = [4, 6, 9, 11]
if x == 2 or y == 2:
    ans = "No"
elif x in a and y in a:
    ans = "Yes"
elif not x in a and not y in a:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
print = sys.stdout.write
x, y = [int(_) for _ in input().split()]
a = [4, 6, 9, 11]
if x == 2 or y == 2:
    ans = "No"
elif x in a and y in a:
    ans = "Yes"
elif not x in a and not y in a:
    ans = "Yes"
else:
    ans = "No"

print(ans)

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

Solution (Python):

x, y = [int(s) for s in input().split()]
groups = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]]

is_same = False

for group in groups:
    if x in group and y in group:
        print('Yes')
        break
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):

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

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

Solution (Python):
def check_exist(n):
    if list1.count(n)!=0:
        return 1
    elif list2.count(n)!=0:
        return 2
    else:
        return 3
x,y=map(int, input().split())
list1=[1,3,5,7,8,10,12]
list2=[4,6,9,11]
list3=[2]
check_x=check_exist(x)
check_y=check_exist(y)
if check_x==check_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:
  if y in A:
    print('Yes')
  else:print('No')
elif x in B:
  if y in B:
    print('Yes')
  else:print('No')
elif x == y == 2:
  print('Yes')
else:print('No')

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

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

x,y = map(int,input().split())
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]
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')
    exit()

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

x_group, y_group = '',''

if x in groupA:
  x_group = 'A'
elif x in groupB:
  x_group = 'B'
elif x in groupC:
  x_group = 'C'
  
if y in groupA:
  y_group = 'A'
elif y in groupB:
  y_group = 'B'
elif y in groupC:
  y_group = 'C'
  
if x_group == y_group:
  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 i in a, b, c:
    if x in i and y in i:
        print('Yes')
        quit()
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) 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())
g = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
ans = False
for z in g:
    if x in z and y in z:
        ans = True
if ans:
    print("Yes")
else:
    print("No")

Solution (Python):




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

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

if (a in s1) and (b in s1):
    print("Yes")
elif (a in s2) and (b in s2):
    print("Yes")
elif (a in s3) and (b in s3):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

x, y = map(int, open(0).read().split())

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

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

if (x in a and y in a) | (x in b and y in b) | (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]
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())
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

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

Solution (Python):
group_a = {1, 3, 5, 7, 8, 10, 12}
group_b = {4, 6, 9, 11}
group_c = {2}

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

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

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

a = [4, 6, 9, 11]

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

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

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

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

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

Solution (Python):
l = list(map(int, input().split()))
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]
print('Yes' if set(l).issubset(g1) or set(l).issubset(g2) or set(l).issubset(g3) 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())

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

Solution (Python):

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

Solution (Python):
x,y=input().split()
a=['1 3 5 7 8 10 12','4 6 9 11','2']
count=0
for i in range(3):
    if a[i].find(x)!=-1 and a[i].find(y)!=-1:
        count+=1
        
    elif x=='2' or y=='2':
        count=count*0
        break
print('Yes' if count>0 else '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:
    ans = "Yes"
elif x in g2 and y in g2:
    ans = "Yes"
else:
    ans = "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, y} <= A or {x, y} <= 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')
else:
    print('No')

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