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

x,y = list(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())
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
if x == y:
    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):
a = list(map(int,input().split()))
b = [1,3,5,7,8,10,12]
c = [4,6,9,11]
d = [2]
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  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 (g1.count(x) == 1 and g1.count(y) == 1) or (
        g2.count(x) == 1 and g2.count(y) == 1) or (g3.count(x) == 1
                                                   and g3.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:
    if y in a:
        print('Yes')
    else:
        print('No')
elif x in b:
    if y in b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Solution (Python):
x,y = map(int,input().split())
result = 0
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")

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):
N = {int(s) for s in input().split()}
print('Yes' if 2 not in N and len({4,6,9,11} & N) != 1 else '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)==(y in list1)==1 or(x in list2)==(y in list2)==1 or (x in list3)==(y in list3)==1:
    print("Yes")
else:
    print("No")

Solution (Python):

import sys
sys.setrecursionlimit(300000)

YES = "Yes"  
NO = "No"  

def solve(x: int, y: int):
    g = [4, 6, 9, 11]
    ret = YES
    if x == 2 or y == 2:
        ret = NO
    elif x in g and not y in g or y in g and not x in g:
        ret = NO
    print(ret)
    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):
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 = list(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')
else:
  print('No')

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

x, y = nl()

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):
    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):
group1 = [1,3,5,7,8,10,12]
group2 = [4,6,9,11]
group3 = [2]

x,y=map(int,input().split())
if (x in group1) and (y in group1):
    print('Yes')
elif (x in group2) and (y in group2):
    print('Yes')
elif (x in group3) and (y in group3):
    print('Yes')
else:
    print('No')

Solution (Python):
x,y=map(int,input().split())
g=[0,1,3,1,2,1,2,1,1,2,1,2,1]
if g[x]==g[y]:
    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]
if x == 2 or y == 2:
    print('No')
elif (x in group1 and y in group1) or (x in group2 and y in group2):
    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]
z = "No"

if x in a and y in a:
    z = "Yes"
if x in b and y in b:
    z = "Yes"
if x == 2 and y == 2:
    z = "Yes"
print(z)

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





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

















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

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

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

Solution (Python):
a,b=map(int,input().split())
if a==2:
 A=2
elif a==4 or a==6 or a==9 or a==11:
 A=1
else:
 A=3
if b==2:
 B=2
elif b==4 or b==6 or b==9 or b==11:
 B=1
else:
 B=3
if A==B:
 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())
for g in group:
  if x in g and y in g:
    print("Yes")
    exit(0)
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):
def abc():
    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:
        print('Yes')
        return
    if x in group2 and y in group2:
        print('Yes')
        return
    print('No')


abc()

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

if not yes:
    print("No")

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

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

Solution (Python):
x,y = map(int,input().split())
grp = [0]*13
grp[2] = 1
for i in [4,6,9,11]:
  grp[i] = 2
print('Yes' if grp[x] == grp[y] else 'No')

Solution (Python):
ans = ["A", "C", "A", "B", "A", "B", "A", "A", "B", "A", "B", "A"]
x, y = map(int, input().split())
if ans[x - 1] == ans[y - 1]:
    print("Yes")
else:
    print("No")

Solution (Python):
import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

x,y = IL()
ga = [1,3,5,7,8,10,12]
gb = [4,6,9,11]

if (x in ga and y in ga) or (x in gb and y in gb):
  print("Yes")
else:
  print("No")

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

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

G = [1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
if G[x] == G[y]:
    print("Yes")
else:
    print("No")

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

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

def both_in(X):
    return x in X and y in X

if both_in(A) or both_in(B) or both_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())
for i in a:
  if x == i:
    x = "a"
  if y == i:
    y = "a"
for i in b:
  if x == i:
    x = "b"
  if y == i:
    y = "b"
if x == y:
  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:
        return 'Yes'
    if x in b and y in b:
        return 'Yes'
    if x in c and y in c:
        return 'Yes'
    return 'No'

print(solve())

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

Solution (Python):
x,y = 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}

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 = [int(x) for x in input().split()]
group_a = set([1, 3, 5, 7, 8, 10, 12])
group_b = set([4, 6, 9, 11])
print('Yes') if (x in group_a and y in group_a) or (x in group_b and y in group_b) 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: print('Yes')
elif x in group2 and y in group2: print('Yes')
else: print('No')

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

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

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

flg = "Yes"

if ls1.count(x) != ls1.count(y):
    flg = 'No'
elif ls2.count(x) != ls2.count(y):
    flg = 'No'
elif ls3.count(x) != ls3.count(y):
    flg = 'No'
else:
    pass

print(flg)

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

    elif (x in group_b) and (y in group_b):
        print('Yes')
        return

    elif (x in group_c) and (y in group_c):
        print('Yes')
        return

    print('No')

resolve()

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):
a, b = [ int(v) for v in input().split() ]
big = [1,3,5,7,8,10,12]
small = [4,6,9,11]
ans = "Yes"
if a == 2 or b ==2:
  ans = "No"
elif a in big and b in small:
  ans = "No"
elif b in big and a in small:
  ans = "No"
print(ans)

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

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

x=set(map(int,input().split()))
if x<=a or x<=b:
  print('Yes')
else:
  print('No')

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

agr = {1,3,5,7,8,10,12}
bgr = {4,6,9,11}
cgr = {2,}

if x in agr: x = 0
elif x in bgr: x = 1
else: x = 2
  
if y in agr: y = 0
elif y in bgr: y = 1
else: y = 2
  
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]
c = [2]

if x in a:
    X = 1
elif x in b:
    X = 2

else:
    X = 3
    
if y in a:
    Y = 1
elif y in b:
    Y = 2

else:
    Y = 3

if X == Y:
    print('Yes')

else:
    print('No')

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

Solution (Python):
x,y=map(int, input().split())
L=[]
if x in [1,3,5,7,8,10,12]:
  L=[1,3,5,7,8,10,12]
elif x in [4,6,9,11]:
  L=[4,6,9,11]
else:
  L=[2]

if y in L:
  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]
if (x in l1 and y in l1) or (x in l2 and y in l2) or (x == 2 and y == 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]
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):


def main():
    x, y = [int(ele) for ele in input().split()]
    a = [1, 3, 5, 7, 8, 10, 12]
    b = [4, 6, 9, 11]
    c = [2]
    ans = "No"
    if x in a and y in a:
        ans = "Yes"
    elif x in b and y in b:
        ans = "Yes"
    elif x in c and y in c:
        ans = "Yes"

    print(ans)


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

flag_x = 0
flag_y = 0

if x in A:
    flag_x = 1
elif x in B:
    flag_x = 2

if y in A:
    flag_y = 1
elif y in B:
    flag_y = 2
    
print('Yes' if flag_x == flag_y else 'No')

Solution (Python):
x,y = map(int,input().split())
s = [n for n in range(1,13)]
a = [2]
b = [4,6,9,11]
c = set(s) -set(a) -set(b)
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)
print('Yes' if (x in g1 and y in g1) or (x in g2 and y in g2) else 'No')

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


if (a==1or a==3 or a==5 or a==7 or a==8 or a==10 or a==12) and (b==1or b==3 or b==5 or b==7 or b==8 or b==10 or b==12):
    print("Yes")
elif (a==4 or a==6 or a==9 or a==11) and (b==4 or b==6 or b==9 or b==11):
    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())
d = set([x,y])
if d.issubset(a)==True or d.issubset(b)==True or d.issubset(c)==True:
  print("Yes")
else:
  print("No")

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

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

if g1.count(a) == 1 and  (g1.count(b) == 1) :
    print("Yes")
elif g2.count(a) == 1 and (g2.count(b) == 1) :
    print("Yes")
elif g3.count(a) == 1 and (g3.count(b) == 1) :
    print("Yes")    
else :
    print("No")

Solution (Python):
x, y = map(int, input().split())
group = [0] * 13
group[ 0] = 1
group[ 2] = 2
group[ 4] = 3
group[ 6] = 3
group[ 9] = 3
group[11] = 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]
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())
list1 = [1,3,5,7,8,10,12]
list2 = [4,6,9,11]

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

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

x,y=input().split()

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

elif a.count(x)==a.count(y)==1:
    print("Yes")

elif b.count(x)==b.count(y)==1:
    print("Yes")
else:
    print("No")

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

if (x == y == '2'):
	print('Yes')
elif (a.count(x) == a.count(y) == 1):
	print('Yes')
elif (b.count(x) == b.count(y) == 1):
	print('Yes')
else:
	print('No')

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

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

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

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):
g1 =[1,3,5,7,8,10,12]
g2 =[4,6,9,11]
g3 = [2]
x,y = map(int, input().split())
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):
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):
    ans='Yes'
else : ans='No'
print(ans)

Solution (Python):
grpA = (1, 3, 5, 7, 8, 10, 12)
grpB = (4, 6, 9, 11)
grpC = (2)
x, y = map(int,input().split())
if (x in grpA and y in grpA) or (x in grpB and y in grpB):
    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):
b, c = map(int, input().split())
type_short = {11:1,4:1,6:1,9:1}
if(c==b and c==2):
  print("Yes")
elif(((b in type_short) ^ ( c in type_short)) or b == 2 or c == 2):
  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 A.count(x)==1:
    X=A
elif B.count(x)==1:
    X=B
else:
    X=C
if A.count(y)==1:
    Y=A
elif B.count(y)==1:
    Y=B
else:
    Y=C
if X==Y:
    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,)]
for g in G:
    if x in g and y in g:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
l=list(map(int,input().split()))
ll=[]

for i in range(2):
    if l[i]==2:
        ll.append("A")
    elif l[i]==4 or l[i]==6 or l[i]==9 or l[i]==11:
        ll.append("B")
    else:
        ll.append("C")
print("YNeos"[ll[0]!=ll[1]::2])

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

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

if list1.count(x) + list1.count(y) == 2:
    print("Yes")
elif list2.count(x) + list2.count(y) == 2:
    print("Yes")
elif list3.count(x) + list3.count(y) == 2:
    print("Yes")
else:
    print("No")

Solution (Python):
i = list(map(int, input().split()))
 
A_list = [1, 3, 5, 7, 8, 10, 12]
B_list = [4, 6, 9, 11]
C_list = [2]
 
if i[0] in A_list and i[1] in A_list:
    print("Yes")
elif i[0] in B_list and i[1] in B_list:
    print("Yes")
elif i[0] in C_list and i[1] in C_list:
    print("Yes")
else:
    print("No")

Solution (Python):



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

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

if i[0] in A_list and i[1] in A_list:
    print("Yes")
elif i[0] in B_list and i[1] in B_list:
    print("Yes")
elif i[0] in C_list and i[1] in C_list:
    print("Yes")
else:
    print("No")

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

Solution (Python):
a,b=input().split()
lis=(("1","3","5","7","8","10","12"),("4","6","9","11"),("2"))
for gn, row in enumerate(lis):
    try:
        A=(gn, row.index(a))
        break
    except ValueError:
        pass
for gn, row in enumerate(lis):
    try:
        B=(gn, row.index(b))
        break
    except ValueError:
        pass    
print("Yes" if A[0]==B[0] 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]
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())
dic = {1: 1, 2: 2, 3: 1, 4: 3, 5: 1, 6: 3,
       7: 1, 8: 1, 9: 3, 10: 1, 11: 3, 12: 2}
if dic[a] == dic[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 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())
s1 = {1,3,5,7,8,10,12}
s2 = {4,6,9,11}
s3 = {2}

def include(i):
  if i in s1:
    return 1
  elif i in s2:
    return 2
  elif i in s3:
    return 3
  else:
    return 0

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

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

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math

mod = 10**9+7

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

group1 = [1,3,5,7,8,10,12]
group2 = [4,6,9,11]


ans = False
if x in group1 and y in group1:
    ans = True

elif x in group2 and y in group2:
    ans = True

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

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

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

def group(n):
    if n in a:
        return a
    elif n in b:
        return b
    else:
        return c
print('Yes') if group(x) == group(y) else print('No')

Solution (Python):
g="ACABABAABABA"
x,y=map(int,input().split())
print("YNeos"[g[x-1]!=g[y-1]::2])

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

Solution (Python):
x, y = map(int, 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')
        quit()
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]
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=[1,2,1,3,1,3,1,1,3,1,3,1]
print('Yes' if Group[x-1] == Group[y-1] else 'No')

Solution (Python):
x,y=map(int,input().split())
list1={4,6,9,11}
list2={2}
list3={1,3,5,7,8,10,12}
print('Yes' if {x,y} < list1 or {x,y} < list2 or {x,y} < list3 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 group in [a, b, c]:
    if x in group and y in group:
        print('Yes')
        exit()
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 = list(map(int, input().rstrip().split()))
lst = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11]]

for i in lst:
    if x in i and y in i:
        print("Yes")
        break
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]
for group in [group_A, group_B, group_C]:
    if x in group and y in group:
        print("Yes")
        break
else:
    print("No")

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

group = [0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]
if group[x - 1] == group[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]
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):

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

    return x, y


def submit():
    x, y = read_input()

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

    if x in group1 and y in group1:
        print('Yes')
        return

    if x in group2 and y in group2:
        print('Yes')
        return

    if x in group3 and y in group3:
        print('Yes')
        return

    print('No')



if __name__ == '__main__':
    submit()

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

Solution (Python):
import sys
x,y = list(input().split())
judge = 0
x = x.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
y = y.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
x = x.replace("10", "1").replace("12", "1").replace("11","4")
y = y.replace("10", "1").replace("12", "1").replace("11","4")

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

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

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

print(ans)

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]) 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())
L=[0,0,2,0,1,0,1,0,0,1,0,1,0]
print(["No","Yes"][L[x]==L[y]])

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

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

print(["No", "Yes"] [L[x] == L[y]])

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

Solution (Python):
a,b=map(int,input().split())
c=[0,0,2,0,1,0,1,0,0,1,0,1,0]
print(["No","Yes"][c[a]==c[b]])

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):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y = f()

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

solve()

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y = f()

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

solve()

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

if x in b and y in b:
    print('Yes')
elif x in a and y in a:
    print('Yes')
else:
    print('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 and y in g_1) or (x in g_2 and y in g_2) or (x in g_3 and y in g_3):
    print('Yes')
else:
    print('No')

Solution (Python):
a,b=map(int,input().split())
s="ACABABAABABA"
a=s[a-1]
b=s[b-1]
print("Yes" if a==b else "No")

Solution (Python):
x, y = [int(n) for n in 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 == 2 or y == 2:
    print('No')
else:
    print('No')

Solution (Python):

x, y = list(map(int, input().rstrip().split()))
lst = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11]]

for i in lst:
    if x in i and y in i:
        print("Yes")
        exit()

print("No")

Solution (Python):

x, y = list(map(int, input().rstrip().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")