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



Sample input:
1 3


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('- {} -> {}'.format(name, val), file=sys.stderr)
            return None

perr('No')
print('No')

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('- {} -> {}'.format(name, val), file=sys.stderr)
            return None

perr('No')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
g1 = {4,6,9,11}
g2 = {1,3,5,7,8,10,12}
if x == 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("Noe")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
l1 = [1, 3, 5, 7, 8, 10, 12]
l2 = [4, 6, 9, 11]
l3 = [2]
ans = 'N0'
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)

Submission status: Wrong Answer

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

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

if A.count(x) != 0 and A.count(y) !=0:
    print("Yes")
elif B.count(x) != 0 and B.count(x) !=0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 a and e in a:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
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 b in a and b in a:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
MIN = 10**11
S1 = 0
S2 =  0
S3 = 0
if H%3 == 0 or W %3==0:
    print(0)
else:
    for i in range(1,H):
        S1 = i * W
        S2 = (H-i)*(W//2)
        S3 = (H-i)*(W - W//2)
        MIN = min(MIN, max(S1,S2,S3)- min(S1,S2,S3))
        
    for i in range(1,W):
        S1 = i * H
        S2 = (W-i)*(H//2)
        S3 = (W-i)*(H - H//2)
        MIN = min(MIN, max(S1,S2,S3)- min(S1,S2,S3))
        
    S1 = H* (W//3)
    S2 = S1
    S3 = H*W - S1 - S2
    MIN = min(MIN, max(S1,S2,S3)- min(S1,S2,S3))
    
    S1 =  W *  (H//3)
    S2 = S1
    S3 = H*W  - S1 - S2
    MIN = min(MIN, max(S1,S2,S3)- min(S1,S2,S3))
        
    print(MIN)

Submission status: Wrong Answer

Solution code:
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:
  ("No")

Submission status: Wrong Answer

Solution code:
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:("No")

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
#ls = list(map(int,input().split()))
#r = int(input())
#s = input()
#x, y = 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 ls.count(y) != 1):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
#ls = list(map(int,input().split()))
#r = int(input())
#s = input()
#x, y = input().split()

ls = [4,6,9,11]

if (ls.count(x) == 1 and ls.count(y) == 1) or (x == 2 and y == 2):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
isOk=False
listA = [1,3,5,6,7,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])

Submission status: Wrong Answer

Solution code:
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) or(x in list2)==(y in list2)or(x in list3)==(y in list3):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

# print(a)
# print(b)
# print(c)

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

# print(a.index(x))
# print(b.index(x))
# print(c.index(x))

# print(a.index(y))
# print(b.index(y))
# print(c.index(y))

# print(x in a)
# print(x in b)
# print(x in c)

# print(b in a)
# print(b in b)
# print(b in c)

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

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

x,y = list(map(int,input().split(" ")))
a= [1,3,5,7,8,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")

Submission status: Wrong Answer

Solution code:
A={1,3,5,6,7,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")

Submission status: Wrong Answer

Solution code:
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_a and y in group_b) else print('No')

Submission status: Wrong Answer

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

    group_a = [1, 3, 5, 7, 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()

Submission status: Wrong Answer

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

    group_a = [1, 3, 5, 7, 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')


if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

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

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

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

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

    print('No')


if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x, y = map(int, input().split(' '))
    
    group_a = [1,3,5,7,10,12]
    group_b = [4,6,9,11]
    
    if x == 2 or y == 2:
        print('No')
        return
    
    if x in group_a and y in group_a:
        print('Yes')
        return
    
    if x in group_b and y in group_b:
        print('Yes')
        return
        
    print('No')
    
if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s="0ACABABAABABA"
x,y=map(int,input().split())
print("YES" if s[x]==s[y] else "NO")

Submission status: Wrong Answer

Solution code:
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) else "NO")

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

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

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

print("YES" if (x in a and y in a)  or (x in b and y in b) else "NO")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
g1 = [2]
g2 = [4,6,9,11]
g3 = [1,2,3,5,7,8,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")

Submission status: Wrong Answer

Solution code:
a=["4","6","9","11"]
b=["1","3","5","7","8","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")

Submission status: Wrong Answer

Solution code:
x, y = input().split()
g = ['4', '6', '9', '11']

if (x == y == 2) or (g.count(x) == g.count(y) == 1):
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
x, y = input().split()
g = ['4', '6', '9', '11']

if (x == y == 2) or g.count(x) == g.count(y) == 1:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
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)):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
b, c = map(int, input().split())
type_short = {2:1,4:1,6:1,9:1}
if(c==b and c==2):
  print("Yes")
elif((b in type_short) ^ ( c in type_short)):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
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")
if i[0] in B_list and i[1] in B_list:
  print("Yes")
if i[0] in C_list and i[1] in C_list:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
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")
if i[0] in B_list and i[1] in B_list:
  print("Yes")
if i[0] in C_list and i[1] in C_list:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
l = [1,3,5,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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
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 i in [group_A, group_B, group_C]:
    if x in i and y in i:
        print("YES")
        break
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
L = [0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=[4,6,9,11]
print(["No","Yes"][(a in c)==(b in c)or a==b==2])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=[4,6,9,11]
print(["No","Yes"][(a in c)==(b in c) or a==b])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=[4,6,9,12]
print(["No","Yes"][(a in c)==(b in c) or a==b])

Submission status: Wrong Answer

Solution code:
d=[0,1,2,1,2,1,2,1,1,2,1,2,1]
a,b=map(int,input().split())
if d[a]==d[b]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a=[i for i in range(1,14,2)]
b=[i for i in range(4,13,2)]
x,y=map(int,input().split())
ans='No'
if (x in a) and (y in a):
    ans='Yes'
elif (x in b) and (y in b):
    ans='Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
a=[i for i in range(1,14,2)]
b=[i for i in range(4,13,2)]
x,y=map(int,input().split())
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
if all([x in a for x in [4,6,9,11]]):
  s='Yes'
  print(s)
  exit()
if 2 in a:
  s='No'
elif any([x in a for x in [4,6,9,11]]):
  s='No'
else:
  s='Yes'
print(s)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
y=False
if all([x in a for x in [4,6,9,11]]):
  s='Yes'
  print(s)
  exit()
if 2 in a:
  s='No'
else:
  s='Yes'
print(s)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());print('NYoe s'[all([a in[4,6,9,11]for a in [x,y]])or(2<y or x!=2)::2])

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
'NYoe s'[all([a in[4,6,9,11]for a in [x,y]])or(2<y or x!=2)::2]

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()));print(['No','Yes'][all([x in [4,6,9,11] for x in a]) or not 2 in a::2])

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()));print('NYoe s'[all([x in [4,6,9,11] for x in a]) or 2 not in a::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
l1 = [1, 3, 5, 7, 9]
l2 = [4, 6, 9, 11]
if x in l1 and y in l1:
    print('Yes')
elif x in l2 and y in l2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
l1 = [1, 3, 5, 7, 9]
l2 = [4, 6, 9, 11]
if (x in l1 and y in l1) or (x in l2 and y in l2):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());print('Yes'if all([a in[4,6,9,11]for a in [x,y]])or all([a not in[4,6,9,11]for a in [x,y]])else 'No')

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());print(['No','Yes'][(all([a!=2 for a in[x,y]])or all([a in[4,6,9,11]for a in [x,y]]))])

Submission status: Wrong Answer

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

for i in listi:
    list1.append(i)
    list2.append(i)
    list3.append(i)

if len(set(list1)) == len(list1) or len(set(list2)) == len(list2) or len(set(list3)) == len(list3):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
A = [2]
B = [4, 6, 9, 11]
C = [1, 3, 5, 7, 8, 10, 12]
print(["No", "Yes"][(X in A and Y in A)or(X in B and Y in B)or(X in C and Y in B)])

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
A = [2]
B = [4, 6, 9, 11]
print(["No", "Yes"][(X in A and Y in A)or(X in B and Y in B)or(X not in A and Y not in B)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == 2 or y == 2:
  print("No")
  exit()
elif x == 4 or x == 6 or x == 9:
  if y == 6 or y == 9 or y == 11:
    print("Yes")
  else:
    print("No")
else:
  if y == 3 or y== 5 or y==7 or y==8 or y==10 or y==12:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
h, w = map(int,input().split())

if w % 3 == 0 or h % 3 == 0:
    print(0)

else:
    s = h * w
    l = [h,w]
    for i in range(0,2):
        if w == 2 and i == 0:
            continue
        a = (int(w/3) + i) * h
        b = (w - (int(w/3) + i)) * int(h/2)
        c = s - a - b
        #print([a,b,c])
        l.append(max([a,b,c])-min([a,b,c]))
    for j in range(0,2):
        if h == 2 and j == 0:
            continue
        a = (int(h/3) + j) * w
        b = (h - (int(h/3) + j)) * int(w/2)
        c = s - a - b
        #print([a,b,c])
        l.append(max([a,b,c])-min([a,b,c]))
    print(min(l))

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
def check(a):
    if (a == 4 or a == 6 or a == 9 or a == 11):
        check_a = "A"
    if a == 2:
        check_a = "B"
    else:
        check_a = "C"
    return check_a
  
if check(X) == check(Y):
    print('Yes')
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#ABC62
x, y = map(int, input().split())
if(x==2 or y==2):
    if(x==y):
        print("Yes")
    else:
        print("No")

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
if(x==2 or y==2):
    if(x==y):
        print("Yes")
    else:
        print("No")

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

Submission status: Wrong Answer

Solution code:


def func(a, b):
    g1 = [1, 3, 5, 7, 8, 10, 12]
    g2 = [4, 6, 9, 11]
    result = 'Yes' if (A in g1 and A in g1) or (A in g2 and B in g2) else 'No'
    return result

A, B = map(int, input().split())

print(func(A, B))

Submission status: Wrong Answer

Solution code:
def main(a, b):
    g1 = ['1', '3', '5', '7', '8', '10', '12']
    g2 = ['4', '6', '9', '11']
    result = 'Yes' if A in g1 and A in g1 or A in g2 and B in g2 else 'No'
    return  result

A, B = input().split()
print(main(A, B))

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
g1 = [1,3,5,78,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')

Submission status: Wrong Answer

Solution code:
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
g3=[2]
a,b=map(int,input().split())
for i in g1:
  if a==i:
    n1=1
  if b==i:
    n2=2
for i in g2:
  if a==i:
    n1=2
  if b==i:
    n2=2
for i in g3:
  if a==i:
    n1=3
  if b==i:
    n2=3
    
if n1==n2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
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 or y in c): 
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 a and y in b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 062 A - Grouping
x,y =map(int,input().split())
ga = [1,3,5,6,8,10,12]
gb = [4,6,9,11]
gc= [2]
if x in ga and y in ga:
    print("Yes")
elif x in gb and y in gb:
    print("Yes")
elif x in gc and y in gc:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9.11]
x, y = map(int, input().split())

if x == y or (x in l1 and y in l1) or (x in l2 and y in l2):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9.11]
x, y = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:
G1 = [1,3,5,7,8,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')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
a = [1,3,5,7,8,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')

Submission status: Wrong Answer

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

if ({x, y} & {4, 6, 9, 11} == {x, y}) or ({x, y} & {1, 3, 5, 7, 8, 10, 12}):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if(a==4 or a==6 or a==9 or a==11):
  aa=2
elif(a==2):
  aa=3
else:
  aa=1
  
if(b==4 or b==6 or b==9 or b==11):
  bb=2
elif(b==2):
  bb=3
else:
  bb=1

if(aa==bb):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
""" AtCoder """

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

Submission status: Wrong Answer

Solution code:
# x, y = map(int, input().split())
x,y = (int(i) for i in input().split())

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

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


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

Submission status: Wrong Answer

Solution code:
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 and g1) or (x in g2 and y in g2) or (x in g3 and y in g3):
#     print("Yes")
# else:
#     print("No")


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

Submission status: Wrong Answer

Solution code:
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 and g1) or (x in g2 and y in g2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
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 and g1) or (x in g2 and y in g2) or (x in g3 and y in g3):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y = (int(i) for i in input().split())
groupA = [1,3,5,7,8,10,12]
groupB = [4,6,9,11]
groupC = [2]
if x in groupA:
  if y in groupA:
    print('Yes')
elif x in groupB :
  if y in groupB :
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a_list=[1,3,5,7,8,10,12]
b_list=[4,6,9,11]
c_list=[2]
x,y=map(int,input().split())
print("Yes" if (x in a_list and y in a_list) or (x in b_list and y in b_list) or (x in c_list and y in c_list) else "NO")

Submission status: Wrong Answer

Solution code:
gp1 = [1,3,5,6,8,10,12]
gp2 = [4,6,9,11]
gp3 = [2]
x,y = [int(i) for i in input().split()]

if ((x in gp1 and y in gp1) or (x in gp2 and y in gp2) or(x in gp3 and y in gp3)) :
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

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