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

x, y = map(str, 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')

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

group_1 = [1, 3, 5, 7, 8, 10, 12]
group_2 = [4, 6, 9, 11]

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

else:
    if x in group_1 and y in group_1:
        print("Yes")

    elif x in group_2 and y in group_2:
        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=3 if x==2 else 1 if x in a else 2
d=3 if y==2 else 1 if y in a else 2
print('Yes' if c==d else 'No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
B,C = map(int,input().split())
aGroup = {1,3,5,7,8,10,12}
bGroup = {4,6,9,11}
if B in aGroup and C in aGroup:
    print("YES")
elif B in bGroup and C in bGroup:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
B,C = map(int,input().split(" "))
aGroup = [1,3,5,7,8,10,12]
bGroup = [4,6,9,11]
if B in aGroup and C in aGroup:
    print("YES")
elif B in bGroup and C in bGroup:
    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}
D= {map(int, input().split())}
print("Yes" if D <= A or D <= B or D <= C else "No")

Submission status: Wrong Answer

Solution code:
A={1, 3, 5, 7, 8, 10, 12}
B={4, 6, 9, 11}
C={2}
print("Yes" if {map(int, input().split())} <= A or B or C \
else "No")

Submission status: Wrong Answer

Solution code:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
a=[4,6,9,11]
print('Yes' if x==y==2 or (x in a and y in a) or (x not in a and y not in a) else '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:
    print('YES')
elif x in B and y in B:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
li = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]]
for i, l in enumerate(li):
    if x in l and y in l:
        print("YES")
        break
    if i == len(li) - 1:
        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) 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:
W,H = map(int,input().split())
ans = 10**30
for i in range(1,W):
    a = H*i
    w = W - i
    b = max((w//2)*H,w*(H//2))
    c = w*H - b
    x = max(a,b,c) - min(a,b,c)
    ans = min(ans,x)
for i in range(1,H):
    a = W*i
    h = H - i
    b = max((W//2)*h,W*(h//2))
    c = h*W - b
    x = max(a,b,c) - min(a,b,c)
    ans = min(ans,x)
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    #a = r.split()
    a = list(map(int, r.split()))
    #a = [int(s[i]) for i in range(1, n+1)]
    #a = [list(map(int, r.split())) for i in range(1,n+1)]
    #res = 0

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

    x = [0]*2
    for i in range(len(a)):
        print(a[i])
        if a[i] in g1:
            x[i] = 1
        elif a[i] in g2:
            x[i] = 2
        elif a[i] in g3:
            x[i] = 3
    if x[0] != 0 and x[0] == x[1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    #a = r.split()
    a = list(map(int, r.split()))
    #a = [int(s[i]) for i in range(1, n+1)]
    #a = [list(map(int, r.split())) for i in range(1,n+1)]
    #res = 0

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

    x = [0]*2
    for i in range(len(a)):
        print(a[i])
        if a[i] in g1:
            x[i] = 1
        elif a[i] in g2:
            x[i] = 2
        elif a[i] in g3:
            x[i] = 3
    if x[0] != 0 and x[0] == x[1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
if H % 3 == 0 or W % 3 == 0:    # 3の倍数だったら最小値は0
    print(0)
    exit()

answer = float('inf')

h = 1
for _ in range(H):
    a = h * W
    b = (H-h) * (W // 2)
    c = H * W - a - b
    MAX = max([a, b, c])
    MIN = min([a, b, c])
    if MAX - MIN <= answer:
        answer = MAX - MIN
    h += 1

w = 1
for _ in range(W):
    a = w * H
    b = (W-w) * (H // 2)
    c = H * W - a - b
    MAX = max([a, b, c])
    MIN = min([a, b, c])
    if MAX - MIN <= answer:
        answer = MAX - MIN
    w += 1

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if (x in aG and y in aG) or (x in bG and y in bG) and (x in cG and y in cG):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=[1,3,5,7,8,10,2]
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")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=[1,3,5,7,8,10,2]
d=[4,6,9,11]
if (a in c and b in c) or (a in d and b in d):
    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 == y == 2:
    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')

Submission status: Wrong Answer

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

list1 = [1,3,5,7,8,10,12]
list2 = [4,6,9,11]

if x in list1:
    if y in list1:
        print('Yes')
elif x in list2:
    if y in list2:
        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 : a=2
elif a==2:a=3 
else: a=1
if b==4 or b==6 or b==9 or b==11 : b=2
elif b==2:b=3 
else:b=1

print("Yes" if a==b else "N0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

s1 = {1,3,5,7,8,10,12}
s2 = {4,6,9,11}

t = set(map(int,input().split()))
for s in [s1, s2]:
  if len(t&s)==2:
    print('YES')
    sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

"""
if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9 and 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　and y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12:
    print("Yes")
else:
    print("No")
"""

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

for i in range(7):
    if A[i] == x:
        for j in range(i,7):
            if A[j] == y:
                tmp = True
for i in range(4):
    if A[i] == x:
        for j in range(i,4):
            if A[j] == y:
                tmp = True
if tmp:
    print("Yes")
if not tmp:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

"""
if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9 and 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　and y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12:
    print("Yes")
else:
    print("No")
"""

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

for i in range(7):
    if A[i] == x:
        for j in range(i,7):
            if A[j] == y:
                tmp = 1
for i in range(4):
    if A[i] == x:
        for j in range(i,4):
            if A[j] == y:
                tmp = 1
if tmp == 1:
    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 b:
  print("Yes")
elif x in b and y in b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
x, y = [int(_) for _ in input().split()]
c1 = [1,3,5,7,8,10,12]
c2 = [4,6,9,11]
c3 = [2]
for t in [c1, c2, c3]:
    if (x in t) and (y in t):
        print("Yes")
print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

"""
if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9 and 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　and y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12:
    print("Yes")
else:
    print("No")
"""

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

for i in range(7):
    if A[i] == x:
        for j in range(7):
            if A[j] == y:
                tmp += 1
for i in range(4):
    if A[i] == x:
        for y in range(4):
            if A[j] == y:
                tmp = 1
if tmp == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9  or y == 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())
a = [1, 3, 5, 7, 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")

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)  or (x-2)*(y-2)!=0) else "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]
print((x in l1 and y in l1) or (x in l2 and y in l2) or (x in l3 and y in l3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A =list(map(int,input().split()))
a=[2]
b=[4,6,9,11]
c=[1,3,5,7,8,12]
if set(A)<=set(a) or set(A)<=set(b) or set(A)<=set(c):
  print('YES')
else:print('NO')

Submission status: Wrong Answer

Solution code:
x,y =map(int,input().split())
number=set([i+1 for i in range(12)])
a=[2]
b=[4,6,9,11]
c=list(set(number)-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')

Submission status: Wrong Answer

Solution code:
# ABC062a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


# Union-Find木


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):  # 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'[uf.same(x-1, y-1)::2])

Submission status: Wrong Answer

Solution code:
S="XACABABABABAB"
a,b=map(int,input().split())
if S[a]==S[b]:
  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")
elif x in b and x in b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if ans == 0 or ans == 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y=input().split()
if x=="10" or x=="12" or x=="1":
  x="0"
if y =="10" or y=="12" or y=="1":
  y="0"
group=["35780","4691","2"]
for i in range(3):
  if x in group[i]:
    if y in group[i]:
      print("Yes")
    else:
      print("No")
    break

Submission status: Wrong Answer

Solution code:
x,y=input().split()
group=["135781012","46911","2"]
for i in range(3):
  if x in group[i]:
    if y in group[i]:
      print("Yes")
    else:
      print("No")
    break

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
if x==4 or x==6 or x==9 or x==11:
  if y==4 or x==6 or y==9 or y==11:
    print('Yes')
elif x==2:
  if y==2:
    print('Yes')
else:
  if y!=2 and y!=4 and x!=6 and y!=9 and y!=11:
    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())

for i in a, b, c:
    if x in i:
        if y in i:
            print('Yes')
print('No')

Submission status: Wrong Answer

Solution code:
a = {1, 3, 5, 7}
b = {4, 6, 9, 11}
c = {2}
x, y = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

Submission status: Wrong Answer

Solution code:
S="XACABABAABABA"
x,y=map(int,input().split())
print("YES" if S[x]==S[y] else 'NO ')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = [4,6,9,11]

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

Submission status: Wrong Answer

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

a = [4,6,9,11]

if x == y:
    print('Yes')
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')

Submission status: Wrong Answer

Solution code:
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
        break
print('Yes' if count>0 else 'No')

Submission status: Wrong Answer

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

if a in group1 and b in group1: print("YES")
elif a in group2 and b in group2: 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==y) or (x in a and y in a) or (x in b and y in b):
  print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    x,y = INTM()
    if x in a:
        x = 21
    elif x in b:
        x = 22
    elif x==2:
        x = 23
    
    if y in a:
        y = 21
    elif x in b:
        y = 22
    elif y==2:
        y = 23
    
    if x==y:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    x,y = INTM()
    if x in a:
        x = 21
    elif x in b:
        x = 22
    else:
        x = 23
    
    if y in a:
        y = 21
    elif x in b:
        y = 22
    else:
        y = 23
    
    if x==y:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    x,y = INTM()
    if x in a:
        x = 1
    elif x in b:
        x = 2
    else:
        x = 3
    
    if y in a:
        y = 1
    elif x in b:
        y = 2
    else:
        y = 3
    
    if x==y:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

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

Submission status: Wrong Answer

Solution code:
group_target = set(map(int, input().split()))

groupa = {1, 3, 5, 7, 9, 10, 12}
groupb = {4, 6, 9, 11}
groupc = {2}

if group_target.issubset(groupa) or group_target.issubset(groupb):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

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

for i in a,b:
    if x in i and y in i:
        print('yes')
        break
    else:
        print('no')
        break

Submission status: Wrong Answer

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

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

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]
print('Yes') if (x in g1 and y in g1) or (x in g2 and y in g2) in g2 or (x in g3 and y in g3) 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]
print('Yes') if (x and y) in g1 or (x and y) in g2 or (x and y) in g3 else print('No')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if x ==2 and y == 2:
    print('Yes')
elif x % 2 == y % 2 and x !=2 and y != 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if x ==2 and y == 2:
    print('Yes')
elif x % 2 == y % 2 and x >=4 and y >= 4:
    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]
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")

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

Submission status: Wrong Answer

Solution code:
s = set(map(int, input().split()))
b = {4, 6, 9, 11}
c = {2}
print('Yes' if s & b == len(s) or s & c == len(
    s) or (s & b == set() and s & c == set()) 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,y} <= a or {x,y} <= b else "No")

Submission status: Wrong Answer

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

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

if a in g1 and b in g1:
  print('Yes')
elif a in g2 and b in g2:
  print('Yes')
elif a in g3 and b in g2:
  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(str, 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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
print('YES' if x==y or (x in [4, 6, 9, 11] and y in [4, 6, 9, 11]) else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9 and 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 and 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())
list_a = [1,3,5,7,8,10,12]
list_b = [4,6,9,11]
print("YES" if (x in list_a and y in list_a) or (x in list_b and y in list_b) else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = input().split()
if x in '135781012' and y in '135781012':
    ans = 'Yes'
elif x in '46911' and y in '46911':
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
S="_ACABABAABABA"
a,b=map(int,input().split())
print("YES" if S[a]==S[b] else "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]

print ("YES" if x in g1 and y in g1 or 
       x in g2 and y in g2 or x in g3 and y in g3 else "NO")

Submission status: Wrong Answer

Solution code:
x,y = (int(i) for i in input().split())
if x == 1 or x == 3 or  x == 5 or  x == 7 or  x == 8 or  x == 10 or  x == 12:
  x = 1
elif x == 2:
  x = 2
else:
  x = 4
if y == 1 or y == 3 or  y== 5 or  y== 7 or  y== 8 or  y== 10 or  y == 12:
  x = 1
elif y == 2:
  y = 2
else:
  y = 4
  
if x == y:
  print('Yes')
else:
  print('No')