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: Accepted

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

x_group, y_group = '',''

if x in groupA:
  x_group = 'A'
elif x in groupB:
  x_group = 'B'
elif x in groupC:
  x_group = 'C'
  
if y in groupA:
  y_group = 'A'
elif y in groupB:
  y_group = 'B'
elif y in groupC:
  y_group = 'C'
  
if x_group == y_group:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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 and y in i:
        print('Yes')
        quit()
print('No')

Submission status: Accepted

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]

if x in group_a and y in group_a:
    print('Yes')
elif x in group_b and y in group_b:
    print('Yes')
elif x in group_c and y in group_c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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: Accepted

Solution code:
x,y = map(int,input().split())
g = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
ans = False
for z in g:
    if x in z and y in z:
        ans = True
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/10/22
x, y = map(int, open(0).read().split())
# print(x,y)
list_a = [1,3,5,7,8,10,12]
list_b = [4,6,9,11]
if ((x in list_a) and (y in list_a)) or ((x in list_b) and (y in list_b)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if (x in a and y in a) | (x in b and y in b) | (x in c and y in c):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

if y in (1,3,5,7,8,10,12):
    y = 1
elif y in (4,6,9,11):
    y = 2
else:
    y = 3

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

Submission status: Accepted

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

x, y = map(int, input().split())
if x in group_a and y in group_a:
  print("Yes")
elif x in group_b and y in group_b:
  print("Yes")
elif x in group_c and y in group_c:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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: Accepted

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

a = [4, 6, 9, 11]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
g = (0, 1, 2, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1)

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

Submission status: Accepted

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

Submission status: Accepted

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:
    X = 'A'
if x in B:
    X = 'B'
if x in C:
    X = 'C'
if y in A:
    Y = 'A'
if y in B:
    Y = 'B'
if y in C:
    Y = 'C'
print('Yes' if X==Y else 'No')

Submission status: Accepted

Solution code:
g = [0,1,3,1,2,1,2,1,1,2,1,2,1]
x,y = map(int,input().split())
print("Yes" if g[x]==g[y] else "No")

Submission status: Accepted

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: Accepted

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

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

if x in group1 and y in group1 or \
   x in group2 and y in group2 or \
   x in group3 and y in group3:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]
print('Yes' if set(l).issubset(g1) or set(l).issubset(g2) or set(l).issubset(g3) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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
        
    elif x=='2' or y=='2':
        count=count*0
        break
print('Yes' if count>0 else 'No')

Submission status: Accepted

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

g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
if x in g1 and y in g1:
    ans = "Yes"
elif x in g2 and y in g2:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x, y = tuple(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: Accepted

Solution code:
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    d = collections.defaultdict(list)
    d[1] += [0]
    d[3] += [0]
    d[5] += [0]
    d[7] += [0]
    d[8] += [0]
    d[10] += [0]
    d[12] += [0]
    d[4] += [1]
    d[6] += [1]
    d[9] += [1]
    d[11] += [1]
    d[2] += [2]
    x, y = list(map(int, input().rstrip('\n').split()))
    print("Yes" if d[x] == d[y] else "No")


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if x==2 and 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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def get_group(n):
  for i, gg in enumerate(g):
    if n in gg:
      return i


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

if get_group(x) == get_group(y):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if x == y == 2:
    print('Yes')
elif x in group1 and y in group1:
    print('Yes')
elif x in group2 and y in group2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

l = [a, b, c]
for d in l:
  if i in d:
    if j in d:
      print("Yes")
      quit()
    else:
      print("No")
      quit()

Submission status: Accepted

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')
else:
  print('No')

Submission status: Accepted

Solution code:
a = [{1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}]
s = set(map(int, input().split()))
print('Yes' if any(s <= x for x in a) else 'No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

if x in CLASS_A:
    class_x = "A"
elif x in CLASS_B:
    class_x = "B"
else:
    class_x = "C"

if y in CLASS_A:
    class_y = "A"
elif y in CLASS_B:
    class_y = "B"
else:
    class_y = "C"

if class_x == class_y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def same_check(a,b,c):
    if a in c and b in c:
        return True
    else:
        return False

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if(a in {1,3,5,7,8,10,12} and b in {1,3,5,7,8,10,12}):
  print("Yes")
  exit()
if(a in {4,6,9,11} and b in {4,6,9,11}):
  print("Yes")
  exit()
if(a in {2} and b in {2}):
  print("Yes")
  exit()
print("No")

Submission status: Accepted

Solution code:
a = {1,3,5,7,8,10,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: Accepted

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:
        d = 21
    elif x in b:
        d = 22
    elif x==2:
        d = 23
    
    if y in a:
        f = 21
    elif y in b:
        f = 22
    elif y==2:
        f = 23
    
    if d==f:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

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

x, y = map(int, input().split())
if x in group_a and y in group_a:
    print('Yes')
elif x in group_b and y in group_b:
    print('Yes')
elif x in group_c and y in group_c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#coding:utf-8

#数字をグループ分けしておく。リストの番号が0始まりなので、最初わざと0を入れる
group = [0,1,3,1,2,1,2,1,1,2,1,2,1]
x, y = map(int, input().split())


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

Submission status: Accepted

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')
else:
    print('No')

Submission status: Accepted

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 == 10 or x == 12:
  x_group = "A"
elif x == 4 or x == 6 or x == 9 or x == 11:
  x_group = "B"
else:
  x_group = "C"
if y == 1 or y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12:
  y_group = "A"
elif y == 4 or y == 6 or y == 9 or y == 11:
  y_group = "B"
else:
  y_group = "C"
if x_group == y_group:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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 or x in c and y in c else 'No')

Submission status: Accepted

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: Accepted

Solution code:



def main():

    group=[1,3,1,2,1,2,1,1,2,1,2,1]
    x,y = map(int,input().split())
    print('Yes' if group[x-1] == group[y-1] else 'No')






if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = (1,3,5,7,8,10,12)
b = (4,6,9,11)
c = set([2])
abc = [a,b,c]
x,y = map(int,input().split())
for i, checker in enumerate(abc):
    if x in checker:
        checker2 = checker
if y in checker2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	x,y = map(int, input().split())
	g1=[1,3,5,7,8,10,12]
	g2=[4,6,9,11]
	g3=[2]
	gll=[g1,g2,g3]
	for g in gll:
		if x in g and y in g:
			return 'Yes'
	return 'No'
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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')
else:
  print('No')

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

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

if ((x in group1 and y in group1) or
   (x in group2 and y in group2) or
   (x in group3 and y in group3)):
      print('Yes')
else:
  print('No')

Submission status: Accepted

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

if x in group2:
    if y in group2:
        print('Yes')
    else:
        print('No')

if x in group3:
    if y in group3:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

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: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

def ans(n):
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    
    if n in a:
        return 0
    if n in b:
        return 1
    if n in c:
        return 2
if ans(a)==ans(b):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
#ABC062A
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)): 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: Accepted

Solution code:
s=list(input().split())
a=int(s[0])
b=int(s[1])
grA=[1,3,5,7,8,10,12]
grB=[4,6,9,11]
grC=[2]
if a in grA:
  if b in grA:
    print('Yes')
  else:
    print('No')
elif a in grB:
  if b in grB:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

first_group = [1, 3, 5, 7, 8, 10, 12]
second_group = [4, 6, 9, 11]

if x == 2 or y == 2:
    print('No')
elif x in first_group and y in second_group:
    print('No')
elif x in second_group and y in first_group:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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: Accepted

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

Solution code:
x,y = map(int,input().split())
A = [0,1,2,1,3,1,3,1,1,3,1,3,1]
if A[x]==A[y]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

groupa = {1, 3, 5, 7, 8, 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: Accepted

Solution code:
d= dict(zip(range(1,13),[0,2,0,1,0,1,0,0,1,0,1,0]))
x,y = [int(x) for x in input().split()]
print("Yes" if d[x]==d[y] else "No")

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

x, y = map(int,input().split())
ans = []

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

Submission status: Accepted

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')
elif x==11:
    print('No')
else :
    print('Yes')

Submission status: Accepted

Solution code:
s=set(map(int,input().split()));print(" YNeos"[s<{1,3,5,7,8,10,12}or{4,6,9,11}>s::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if (x-4)*(x-6)*(x-9)==0 and (y-11)*(y-6)*(y-9)==0:
  print('Yes')
  exit()
elif (x-1)*(x-3)*(x-5)*(x-7)*(x-8)*(x-10)==0 and (y-12)*(y-3)*(y-5)*(y-7)*(y-8)*(y-10)==0:
  print('Yes')
  exit()
print('No')

Submission status: Accepted

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

g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]
judge = []
for index, g in enumerate([g1, g2, g3]):
    if x in g:
        judge.append(index)
    if y in g:
        judge.append(index)
if len(set(judge)) == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = [int(num) for num in input().split()]
group1 = {1, 3, 5, 7, 8, 10, 12}
group2 = {4, 6, 9, 11}
group3 = {2}
L = [group1, group2, group3]
for group in L:
  if set([x, y]) <= group:
    print("Yes")
    break
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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 print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import datetime
x, y = map(int,input().split())
if (datetime.date(1, x, 1) + datetime.timedelta(days=32)).day \
    == (datetime.date(1, y, 1) + datetime.timedelta(days=32)).day:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

if x in a_group and y in a_group:
    print('Yes')
elif x in b_group and y in b_group:
    print('Yes')
elif x in c_group and y in c_group:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = {1, 3, 5, 7, 8, 10, 12}
B = {4, 6, 9, 11}
C = {2}
X, Y = map(int, input().split())

print('Yes' if {X, Y} <= A or {X, Y} <= B or {X, Y} <= C else 'No')

Submission status: Accepted

Solution code:
group31 = {1, 3, 5, 7, 8, 10, 12}
group30 = {4, 6, 9, 11}
group28 = {2}

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

if x in group31 and y in group31 or x in group30 and y in group30 or x in group28 and y in group28:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = 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: Accepted

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

def judge_abc(z):
    A = [1, 3, 5, 7, 8, 10, 12]
    B = [4, 6, 9, 11]
    C = [2]
    if z in A: return 1
    elif z in B: return 2
    else: return 3

if judge_abc(x)==judge_abc(y):print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]
C = [2]
if A.count(x) * A.count(y) + B.count(x) * B.count(y) + C.count(x) * C.count(y):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]
if A.count(x) * A.count(y) + B.count(x) * B.count(y):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
s = input().split()
s = map(int, s)
res = []
group1 = [1, 3, 5, 7, 8, 10, 12]
group2 = [4, 6, 9, 11]
group3 = [2]
for i in s:
    if i in group1:
        res.append('group1')
    elif i in group2:
        res.append('group2')
    else:
        res.append('group3')
if len(list(set(res))) == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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