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 = [4,6,9,	11]
x,y = list(map(int, input().split()))
if x ==2 or y ==2:
  print("No")
elif x in a and y in a:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for s in setA:
  if x in setA and y in setA:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
group_1 = (1,2,5,7,8,10,12)
group_2 = (4,7,9,11)
group_3 = (2,)
if x in group_1 and y in group_1:
    print('Yes')
elif x in group_2 and y in group_2:
    print('Yes')
elif x in group_3 and y in group_3:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
x,y = map(int,input().split())
A = {1,3,5,7,8,10,12}
B = {4,6,9,11}
C = {2}
S = {x,y}
if S <= A or S <= B is True:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

if a==2 or b==2:
  print("No")
elif a==4 or a==6 or a==9 or a==11:
  if b!=4 and b!=6 and b!=9 or b!=11:
    print("No")
  else:
      print("Yes")
else:
  if b==2 or b==4 or b==6 or b==9 or b==11:
    print("No")
  else:
    print("Yes")

Submission status: Wrong Answer

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

if(x&y in a):
    print("Yes")

elif(x & y in b):
    print("Yes")

elif(x & y in c):
    print("Yes")

else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a=list(map(int,input().split()))
flg=0
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
C=[2]
for i in range(len(A)):
    if A[i]==a[0]:
        for j in range(len(A)):
            if A[j]==a[1]:
                flg=1
for i in range(len(B)):
    if B[i]==a[0]:
        for j in range(len(B)):
            if B[j]==a[1]:
                flg=1
if flg==1:
    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=input().strip().split(" ")
e=[int(i) for i in d]

if e[0] and e[1] in a:
    print("Yes")

elif e[0] and e[1] in b:
    print("Yes")

elif e[0] and e[1] in c:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = set([1,3,5,7,8,10,12])
B = set([4,6,8,11])
L = set([int(i) for i in input().split()])
#print(A,B,L)
if len(A&L) == 2 or len(B&L) == 2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
A = set([1,3,5,7,8,10,12])
B = set([4,6,8,11])
L = set([int(i) for i in input().split()])
print(A,B,L)
if len(A&L) == 2 or len(B&L) == 2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
A = set([1,3,5,7,8,10,12])
B = set([4,6,8,11])
L = set([i for i in input().split()])
if len(A&L) == 2 or len(B&L) == 2:
  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 = input().split()
L = [A, B, C]
for i in L:
  if x in i and y in i:
    print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import calendar

a,b = map(int,input().split())
_, lastday =calendar.monthrange(2018, a)
_, lastdayb = calendar.monthrange(2018,b)
print("Yes" if a == b else "No")

Submission status: Wrong Answer

Solution code:
A = [4,6,9,1]
x,y = map(int,input().split())
if x in A:
  x = 1
elif x != 2:
  x = 3
if y in A:
  y = 1
elif y != 2:
  y = 3
if x == y:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
num = list(map(int, input().split()))
if num[0]==2  or num[1] ==2:
	print('No')
elif num[0] == 4:
	if num[1] == 6 or num[1] == 9 or num[1] == 11:
		print('Yes')
	else:
		print('No')
elif num[0] == 6:
	if num[1] == 9 or num[1] == 11:
		print('Yes')
	else:
		print('No')
elif num[0] == 9:
	if num[1] == 11:
		print('Yes')
	else:
		print('No')
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
x, y = list(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')

elif x == 2 and y == 2:
    print('Yes')

else:
    print('No')

Submission status: Wrong Answer

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

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

if x & y in risuto1:
    print("yes")
elif x & y in risuto2:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

if x == 2 or y == 2:
    print("No")
else:
    if x in listB:
        if y in listB:
            print("Yes")
        else:
            print("No")
    if x in listA and y in listA:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
x, y = map(int, input().split())

G1 = [1,3,5,7,8,10,12]
G2 = [4,6,8,11]

if (x in G1 and y in G1) or (x in G2 and y in G2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
x, y = input().split()

G1 = ["1","3","5","7","8","10","12"]
G2 = ["4","6","8","11"]

if (x in G1 and y in G1) or (x in G2 and y in G2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = [1,3,5,6,8,10,12]
b = [4,6,9,11]
# c = [2]
if x == 2 or y == 2:
    print("No")
else:
    if (x in a)  and  (y in a):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
x,y=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:
a = [[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 and y) in a[i]:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
a = [[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 and y in a[i]:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y = input().split()
for i in range(3):
  if (x and y) in a[i]:
    print('Yes')
    exit()
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 a 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,12]
b=[4,6,9,11]
c=[2]
if x in a and y in a:
    print("Yes")
elif x in a 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:
print('Yneos'['2'in input()::2])

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    x, y = input().split()
    p1, p2, p3 = "1,3,5,7,8,10,12", "4,6,9,11", "2"

    if x in p1:
        xg = 1
    elif x in p2:
        xg = 2
    else:
        xg = 3

    if y in p1:
        yg = 1
    elif y in p2:
        yg = 2
    else:
        yg = 3

    if xg == yg:
        print("Yes")
    else:
        print("No")


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(["No","Yes"][input().count('2')])

Submission status: Wrong Answer

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

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

if (x in s1 and y in s1) or \
        (x in s1 and y in s1) or \
        (x in s1 and y in s1):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a=['4','6','9','11']
b=2
x,y=map(int, input().split())
if 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')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 and y in (G1 or G2 or G3):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

n,m=map(int,input().split())

if n in a == m in a:
  print("Yes")
elif n in b == m in b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def main():
    x , y = map(int,input().split(" "))
    a = [1, 3, 5, 7, 8, 10, 12]
    b = [4, 6, 9, 11]
    r = False
    #c = [2]
    for i in a:
        if x == i :
            for j in a:
                if y == j:
                    r = True
        else:
            for k in b:
                if x == k:
                    for h in b:
                        if y == h:
                            r = True
    if r == True:
        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")
if x == 2 and y == 2:
    print("Yes")
if x == 2 and y != 2:
    print("No")
if x != 2 and y == 2:
    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 and y == 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
x,y = map(int,input().split())
li = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
for i in li:
    if x and y in i:
        print("Yes")
        exit()
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 in li:
    if x and y in i:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

if group1.count(x) > 0 and group1.count(y) > 0:
  print("Yes")
  sys.exit()

if group2.count(x) > 0 and group2.count(y) > 0:
  print("Yes")
  sys.exit()

if group3.count(x) > 0 and group2.count(y) > 0:
  print("Yes")
  sys.exit()

print("No")

Submission status: Wrong Answer

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

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

g = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

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

Submission status: Wrong Answer

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

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

yes=False
for i in group:
    if N[0] in i and N[1] in i:
        print("YES")
        yes=True
        
if not yes:print("NO")

Submission status: Wrong Answer

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

# AtCoder Beginner Contest
# Problem A

if __name__ == '__main__':
    x, y = map(int, input().split())

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

    if ((x in groupA) and (x in groupA))  or ((x in groupB) and (y in groupB))  or ((x in groupC) and (y in groupC)):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

# AtCoder Beginner Contest
# Problem A

if __name__ == '__main__':
    x, y = map(int, input().split())

    groupA = [1, 3, 5, 7, 8, 10, 12]
    groupB = [4, 6, 9, 11]

    if ((x in groupA) and (x in groupA)) or ((x in groupB) and (y in groupB)):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

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

ok = False
if x in A and y in A:
    ok = True
elif x in B and y in B:
    ok = True

print('Yes' if ok else 'No')

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());f=lambda x,l:len(set(x)-set(l))==0;print(["No","Yes"][f(s,[1,3,5,7,8,10,12])or f(s,[4,6,9,11])or f(s,[2])])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());f=lambda x,l:set(x)-set(l)==0;print(["No","Yes"][f(s,[1,3,5,7,8,10,12])or f(s,[4,6,9,11])or f(s,[2])])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());f=lambda x,l:all([e in l for e in x]);print(["No","Yes"][f(s,[1,3,5,7,8,10,12])or f(s,[4,6,9,11])or f(s,[2])])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());f=lambda x,l:any([e in l for e in x]);print(["No","Yes"][f(s,[1,3,5,7,8,10,12])or f(s,[4,6,9,11])or f(s,[2])])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());f=lambda x,l:any([e in l for e in x]);print(["No","Yes"][f(s,[1,3,5,7,8,10,12])or f(s,[4,6,9,11])])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());print(["No","Yes"][s in[1,3,5,7,8,10,12]or s in[4,6,9,11]])

Submission status: Wrong Answer

Solution code:
s=map(int,input().split());print("yes"if s in[1,3,5,7,8,10,12]or s in[4,6,9,11]else"no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = [0, 0, 0]

if(a == 1 or a == 3 or a == 5 or a == 7 or a == 8 or a == 10 or a == 12):
    l[0] = 1
elif(a == 2):
    l[2] = 1
else:
    l[1] = 1

if((b == 1 or b == 3 or b == 5 or b == 7 or b == 8 or b == 10 or b == 12)
   and l[0]):
    print("Yes")
elif(b == 2 and l[2]):
    print("Yes")
elif(l[1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
val = [int(x) for x in input().split()]
if val[0] == 2 or val[1] == 2:
    print("NO")
elif val[0] in [4,6,9,11] and val[1] in [4,6,9,11]:
    print("YES")
elif val[0] in [1,3,5,7,8,10,12] and val[1] in [1,3,5,7,8,10,12]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
val = [int(x) for x in input().split()]
if val[0] == 2 or val[1] == 2:
    print("NO")
elif val[0] in [4,6,9,11] and val[1] in [4,6,9,11]:
    print("YES")
elif val[0] in [1,3,5,7,8,10,12] and val[1] in [1,3,5,7,8,10,12]:
    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:
	print('0')
else:
	a = h
	s = []
	if a%2 == 0:
		d = a/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
	else:
		d = (a-1)/2
		if w%3 == 1:
			b = (w-1)/3
			c = w - b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
		else:
			b = (w+1)/3
			c = w-b
			s.append(a*b)
			s.append(c*d)
			s.append(c*(d+1))
	ans1 = abs(int(max(s)-min(s)))
	x = w
	w = h
	h = x
	if h%3 == 0 or w%3 == 0:
		print('0')
	else:
		a = h
		k = []
		if a%2 == 0:
			d = a/2
			if w%3 == 1:
				b = (w-1)/3
				c = w - b
				k.append(a*b)
				k.append(c*d)
			else:
				b = (w+1)/3
				c = w-b
				k.append(a*b)
				k.append(c*d)
		else:
			d = (a-1)/2
			if w%3 == 1:
				b = (w-1)/3
				c = w - b
				k.append(a*b)
				k.append(c*d)
				k.append(c*(d+1))
			else:
				b = (w+1)/3
				c = w-b
				k.append(a*b)
				k.append(c*d)
				k.append(c*(d+1))
		ans2 = abs(int(max(k)-min(k)))
	if ans1 <= ans2:
		print(ans1)
	else:
		print(ans2)

Submission status: Wrong Answer

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

a = [1, 3, 5, 8, 10, 12]

b = [4, 6, 9, 11]

if x == 2 or y == 2:
    if x == 2 and y == 2:
        print 'Yes'
    else:
        print 'No'
else:
   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, raw_input().split())

a = [1, 3, 5, 8, 10, 12]

b = [4, 6, 9, 11]

if x == 5 or y == 5:
    if x == 5 and y == 5:
        print 'Yes'
    else:
        print 'No'
else:
   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, raw_input().split())

a = [1, 3, 5, 8, 10, 12]

b = [4, 6, 9, 11]

if x == 5 or y == 5:
    if x == 5 and y == 5:
        print 'Yes'
    else:
        print 'No'
else:
   if x in a and y in a:
       print 'Yes'
   elif y in a and y in a:
       print 'Yes'
   else:
       print 'No'

Submission status: Wrong Answer

Solution code:
print(['No','Yex'][(lambda a,b:a[b[0]-1]==a[b[1]-1])([0,2,0,1,0,1,0,0,1,0,1,0],list(map(int,input().split())))])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = [1, 3, 5, 6, 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) or (x == y == 2) else 'No')

Submission status: Wrong Answer

Solution code:
a = [1, 3, 5, 6, 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: Wrong Answer

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

def calc(x):
    if x == 2:
        return  -1
    elif  x == 4 or x == 6 or x == 9 or x == 11:
        return  -2
    else:
        return  -3

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
hoge = [[1,3,5,7,8.10,12], [4,6,9,11],[2]]
ans = "No"
for e in hoge:
    if x in e and y in e:
        ans = "Yes"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

def jj(n):
        if n in a:
            return 1
        if n in b:
            return 2
        if n in c:
            return 3

if jj(x)==jj(y):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

d=[int(i) for i in input().split()]

def judge(d):
    if (d[0] in a) and (d[1] in a):
        print("Yes")
    elif (d[0] in b) and (d[1] in b):
        print("Yes")
    elif (d[0] in c) and (d[1] in c):
        print("Yes")
    else:
        print("No")

judge(d)

Submission status: Wrong Answer

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

d=[int(i) for i in input().split()]

def judge(d):
    if (d[0] in a) and (d[1] in a):
        print("Yes")
    elif (d[0] in b) and (d[1] in b):
        print("Yes")
    elif (d[0] in b) and (d[1] in b):
        print("Yes")
    else:
        print("No")

judge(d)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np

h, w = map(int, input().split())

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

m = 10000000000000000000000000
for _ in range(2):
    for i in range(1, h+1):
        v = np.array([i*w, w//2*(h-i), (w+1)//2*(h-i)])
        tmp = max(v) - min(v)
        if tmp < m:
            m = tmp
    h, w = w, h

print(m)

Submission status: Wrong Answer

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

x,y = map(int,(input().split()))
cou1 = 0
cou2 = 0

for i in a:
    if i==x or i==y:
        cou1 += 1
for i in b:
    if i==x or i==y:
        cou2 += 1

if cou1>1 or cou2>1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    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 in [2] and y in [2]:
        print("Yes")
    else:
        print("no")

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

input_lines=raw_input()
input_numbers=input_lines.split()
n=map(int,input_numbers)

if group[n[0]] == group[n[1]]:
    print "Yes"
else:
    print "NO"

Submission status: Wrong Answer

Solution code:
#coding: utf-8

group={'a':[1,3,5,7,8,10,12],'b':[4,6,9,11],'c':[2]}

input_lines=raw_input()
input_numbers=input_lines.split()
n=map(int,input_numbers)#n[0]とn[1]に数字

first_group = False
second_group = False

for i in group:
    for j in range(0,len(group[i])):
        if group[i][j] == n[0]:
            first_group = True
        if group[i][j] == n[1]:
            second_group = True
    if first_group == True and second_group==False or first_group == False and second_group == True:
        print "No"
        break

if first_group and second_group:
    print "yes"

Submission status: Wrong Answer

Solution code:
#coding: utf-8

group={'a':[1,3,5,7,8,10,12],'b':[4,6,9,11],'c':[2]}

input_lines=raw_input()
input_numbers=input_lines.split()
n=map(int,input_numbers)#n[0]とn[1]に数字

first_group = False
second_group = False

for i in group:
    for j in range(0,len(group[i])):
        if group[i][j] == n[0]:
            first_group = True
        if group[i][j] == n[1]:
            second_group = True
    if first_group == True and second_group==False or first_group == False and second_group == True:
        print "No"
        break

if first_group and second_group:
    print "yes"

Submission status: Wrong Answer

Solution code:
#coding: utf-8

group={'a':[1,3,5,7,8,10,1],'b':[4,6,9,11],'c':[2]}

input_lines=raw_input()
input_numbers=input_lines.split()
n=map(int,input_numbers)#n[0]とn[1]に数字

first_group = False
second_group = False

for i in group:
    for j in range(0,len(group[i])):
        if group[i][j] == n[0]:
            first_group = True
        if group[i][j] == n[1]:
            second_group = True
    if first_group == True and second_group==False or first_group == False and second_group == True:
        print "No"
        break

if first_group and second_group:
    print "yes"

Submission status: Wrong Answer

Solution code:
#!/bin/usr/python

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

x,y = [int(i) for i in 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:
a=[0,1,3,1,2,1,2,1,1,2,1,2,1]
x,y=list(map(int,input().split()))
if a[x]==a[y]:
    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,5,9,11]
c = [2]

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

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:
a = [0,1,2,1,3,1,3,1,1,3,1,3,1]

x,y = list(map(int,input().split()))
if a[x]==a[y]:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
def check(n):
    if n==2:
        return 0
    elif ((n==4 or n==6) or n==9) or n==11:
        return 1
    else:
        return 2

x,y = list(map(int,input().split()))
if check(x)==check(y):
    print("yes")
else:
    print("no")