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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if x in agr: x = 0
elif x in bgr: x = 1
else: x = 2
  
if y in agr: y = 0
elif y in bgr: y = 1
else: y = 2
  
print('Yes' if x==y else 'No')

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 = 1
elif x in b:
    X = 2

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

else:
    Y = 3

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

else:
    print('No')

Submission status: Accepted

Solution code:
s="0ACABABAABABA"
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())
L=[]
if x in [1,3,5,7,8,10,12]:
  L=[1,3,5,7,8,10,12]
elif x in [4,6,9,11]:
  L=[4,6,9,11]
else:
  L=[2]

if y in L:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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:


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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

flag_x = 0
flag_y = 0

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

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
s = [n for n in range(1,13)]
a = [2]
b = [4,6,9,11]
c = set(s) -set(a) -set(b)
if x in a and y in a :
  print("Yes")
elif x in b and y in b :
  print("Yes")
elif x in c and y in c :
  print("Yes")
else :
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
group = [0] * 13
group[ 0] = 1
group[ 2] = 2
group[ 4] = 3
group[ 6] = 3
group[ 9] = 3
group[11] = 3

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x,y=input().split()

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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,y}<=a or {x,y}<=b else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

G = [(1, 3, 5, 7, 8, 10, 12),
     (4, 6, 9, 11),
     (2,)]
for g in G:
    if x in g and y in g:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
a,b=input().split()
lis=(("1","3","5","7","8","10","12"),("4","6","9","11"),("2"))
for gn, row in enumerate(lis):
    try:
        A=(gn, row.index(a))
        break
    except ValueError:
        pass
for gn, row in enumerate(lis):
    try:
        B=(gn, row.index(b))
        break
    except ValueError:
        pass    
print("Yes" if A[0]==B[0] else "No")

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

Submission status: Accepted

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

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" 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())
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())
s1 = {1,3,5,7,8,10,12}
s2 = {4,6,9,11}
s3 = {2}

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

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

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


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

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

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

Submission status: Accepted

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

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]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
p=[0,1,3,1,2,1,2,1,1,2,1,2,1,]
a,b=( int(x) for x in raw_input().split())
print ['No','Yes',][p[a]-p[a]+ int(p[a]==p[b])]

Submission status: Accepted

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

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

for g in G:
    if x in g and y in g:
        print('Yes')
        quit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 group in [a, b, c]:
    if x in group and y in group:
        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())
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 - Grouping
x, y = list(map(int, input().rstrip().split()))
lst = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11]]

for i in lst:
    if x in i and y in i:
        print("Yes")
        break
else:
    print("No")

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

    return x, y


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

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

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

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

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

    print('No')



if __name__ == '__main__':
    submit()

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:
x,y=map(int,input().split())
a=[0,2,0,1,0,1,0,0,1,0,1,0]
if a[x-1]==a[y-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

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

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

    some_dic = {}

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

    x , y = f()

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

solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
g_1 = (1, 3, 5, 7, 8, 10, 12)
g_2 = (4, 6, 9, 11)
g_3 = (2,)

if (x in g_1 and y in g_1) or (x in g_2 and y in g_2) or (x in g_3 and y in g_3):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# ABC062A - Grouping
x, y = list(map(int, input().rstrip().split()))
lst = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11]]

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


x, y = inl()
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 == 2 and b == 2:
    print("Yes")
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = True
for i in range(3):
    if x in g[i] and y in g[i]:
        print("Yes")
        flag=False
        break
if flag:
    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:
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
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: 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:
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:
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]

x, y = [int(item) for item in input().split()]
if x in a and y in a:
    print("Yes")
    exit()
if x in b and y in b:
    print("Yes")
    exit()
if x in c and y in c:
    print("Yes")
    exit()
else:
    print("No")

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a, b = (int(_) for _ in input().split())
    l1 = [1,3,5,7,8,10,12]
    l2 = [4,6,9,11]
    if (a in l1 and b in l1) or (a in l2 and b in l2) or (a == 2 and b ==2):
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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



print("Yes" if (a in g1 and b in g1) or (a in g2 and b in g2) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [1,3,1,2,1,2,1,1,2,1,2,1]

x,y = map(int, input().split())
if a[x-1] == a[y-1]:
    print("Yes")
else:
    print("No")

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

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

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

Submission status: Accepted

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 sum([x in a for x in [4,6,9,11]])==1:
  s='No'
else:
  s='Yes'
print(s)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
ans = [0, 0]
x = list(map(int, input().split()))
for i, xi in enumerate(x):
    if xi in a:
        ans[i] = 1
    elif xi in b:
        ans[i] = 2
if ans[0] == ans[1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    x, y = map(int, input().split())

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

    if x in a and y in a:
        return 'Yes'
    elif x in b and y in b:
        return 'Yes'
    elif x in c and y in c:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = {
 1: 0,
 3: 0,
 5: 0,
 7: 0,
 8: 0,
 10: 0,
 12: 0,
 4: 1,
 6: 1,
 9: 1,
 11: 1,
 2: 2,
}

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l={4,6,9,11}
m=set(range(13))-l-{2}
A=set(map(int,input().split()))
print("YNeos"[A&l!=A and A&m!=A::2])

Submission status: Accepted

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