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: Runtime Error

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: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y = map(int, input().split())
ans='No'
if x,y 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: Runtime Error

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

Submission status: Runtime Error

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

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

if a in ls1[2]:
  print('NO')
else if a in ls1[1]:
  if b in ls1[1]:
    print("Yes")
  else:
    print("No")
else if a in ls1[0]:
  if b in ls1[0]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
s='0131212112121'
print("Yes" if s[x]==s[y] else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

X, Y=map(int,input().split())

if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w = map(int, input().split())
a = [input() for i in range(h)]
b = []
 
for i in range(h):
  a[i].insert(0,'#')
  a[i].append('#')
  
for i in range(w+2):
  b.append('#')
 
a.insert(0,b)
a.append(b)
  
for i in a:
  print("".join(list(map(str,i))))

Submission status: Runtime Error

Solution code:
h,w = map(int, input().split())
a = [input().split() for i in range(h)]
 
a = {}
b = []
 
for i in h:
  a[i].insert(0,'#')
  a[i].append('#')
  
for i in w+2:
  b.append('#')

a.insert(0,b)
a.append(b)
  
for i in a:
  print("".join(list(map(str,i))))

Submission status: Runtime Error

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

for i in range(3):
  if x in a[i] and y in a[i]:
    print('Yes')
  else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
H,W = list(map(int,input().split()))
a = [input() for i in range(H)]

for i in range(H+2):
  if i==0 or i==H+1:
    print("#"*(W+2))
  else:
    print("#"+a[i-1]+"#")

Submission status: Runtime Error

Solution code:
def judge(x):
  if x==4 or x==6 or x==9 or x==11:
    y = a
  elif x==12:
    y = b
  else:
    y = c
  return y

a,b = map(int,input().split())
if judge(a) == judge(b) :
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
b = list(1,3,5,7,8,10,12)
c = list(4,6,9,11)
d = list(2)
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
a,b=map(int,input().split())
if a==2:
 A==2
elif a==4 or a==6 or a==9 or a==11:
 A==1
else:
 A==3
if b==2:
 B==2
elif B==4 or B==6 or B==9 or B==11:
 B==1
else:
 B==3
if A==b:
 print("Yes")
else:
 print("No")

Submission status: Runtime Error

Solution code:
i = list(map(int,input().split()))
A_list[1,3,5,7,8,10,12]
B_list[4,6,9,11]
C_list[2]
if i[0] in A_list and i[1] in A_list:
  print("Yes")
if i[0] in B_list and i[1] in B_list:
  print("Yes")
if i[0] in C_list and i[1] in C_list:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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


print("#"*(w+2))
for i in range(h):
    x=input()
    print("#"+x+"#")
    
print("#"*(w+2))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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 ={}

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

solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
d=[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: Runtime Error

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

Submission status: Runtime Error

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=2 or y=2:
  print("No")
for v in a:
  if x=v:
    for w in a:
      if w =y:
        print("Yes")
for v in b:
  if x=v:
    for w in b:
      if w =y:
        print("Yes")
else:
  print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	temp := [13]int{0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1}
	if temp[a] == temp[b] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
picture = [input() for i in range(H)]
print('#'*(W+2))
for i in range(H):
    print('#' + picture[i] + '#')
print('#'*(W+2))
#コピペです。

Submission status: Runtime Error

Solution code:
# -*- coding; utf-8 -*-
H,W = map(int,input().split())
a = []
for i in range(H):
  a.append(map(str,input().split()))
print("#####")
while i < H:
  print("#"+str(a[i])+"#")
  i=i+1
print("#####")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,6,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])

Submission status: Runtime Error

Solution code:
a = %w(1 3 5 7 8 10 12)
b = %w(4 6 9 12)
c = %w(2)

x, y = gets.chomp.split

[a, b, c].each do |s|
    if s.include? x and s.include? y
        puts 'Yes'
        exit
    end
end

puts 'No'

Submission status: Runtime Error

Solution code:
groups = [[1, 3, 5, 7, 8, 12], [4, 6, 9, 11], [2]]
gg = lambda t: [i for i in range(0, 3) if t in groups[i]][0]
x, y = map(int, input().split())
print('Yes' if gg(x) == gg(y) else 'No')

Submission status: Runtime Error

Solution code:
g1, g2, g3 = {1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}
print('Yes' if {a, b} in g1 or {a, b} in g2 else 'No')

Submission status: Runtime Error

Solution code:
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }

    static class Task {
        public void solve(Scanner sc, PrintWriter out) {
            int x = nint(sc);
            int y = nint(sc);

            int[] group = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2 ,1 , 2, 1};
            out.println(group[x] == group[y] ? "Yes" : "No");
        }
    }


    static int nint(Scanner sc) {
        return Integer.parseInt(sc.next());
    }

    static long nlong(Scanner sc) {
        return Long.parseLong(sc.next());
    }

    static double ndouble(Scanner sc) {
        return Double.parseDouble(sc.next());
    }

    static float nfloat(Scanner sc) {
        return Float.parseFloat(sc.next());
    }

    static String nstr(Scanner sc) {
        return sc.next();
    }

    static long[] longLine(Scanner sc, int size) {
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }

    static int[] intLine(Scanner sc, int size) {
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }

    static String[] strLine(Scanner sc, int size) {
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }

    static long maxFromList(List<Long> longList) {
        return longList.stream().max(Comparator.naturalOrder()).get();
    }

    static long minFromList(List<Long> longList) {
        return longList.stream().min(Comparator.naturalOrder()).get();
    }

    public static int sumDigits(int n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    public static long sumDigits(long n) {
        long sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    static List<Integer> getIntegerList(Scanner sc, int size) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            list.add(nint(sc));
        }
        return list;
    }

    static List<Long> getLongList(Scanner sc, int size) {
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            list.add(nlong(sc));
        }
        return list;
    }
}

Submission status: Runtime Error

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: Runtime Error

Solution code:
print('YNeos'[2in input()::2])

Submission status: Runtime Error

Solution code:
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: Runtime Error

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")
        sys.exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=1;i<=n;++i)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
using namespace std;

int main(){
  int a,b,a_g,b_g;
  cin >> a >> b;
  int comp[3][7]={{1,3,5,7,8,10,12},{4,6,9,11,0,0,0},{2,0,0,0,0,0,0}};
  rep(i,3){
   rep(j,7){
     if (comp[i][j]==a) a_g=i;
     if (comp[i][j]==b) b_g=i;
   }
  }
  if (a_g==b_g) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Submission status: Runtime Error

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

tup = ((1,3,5,7,8,10,12),(4,6,9,11),(2))

if __name__=="__main__":
  x = input()
  y = input()
  x_g = 0
  y_g = 0
  for i in range(3):
    if x in tup[i]:
      x_g=i
    if y in tup[i]:
      y_g=i
  if y_g==x_g:
    print('Yes')
  else:
    print('No')

Submission status: Runtime Error

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

tup = ((1,3,5,7,8,10,12),(4,6,9,11),(2))

if __name__=="__main__":
  x = input()
  y = input()
  x_g = 0
  y_g = 0
  for i in range(3):
    if x in tup(i):
      x_g=i
    if y in tup(i):
      y_g=i
  if y_g==x_g:
    print('Yes')
  else:
    print('No')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

h,w=map(int,input().split())
for i in range(h+2):
    if i==0 or i==h+1:
        print("#"*w+"##")
    else:
        a=input()
        print("#"+a+"#")

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
x = input()
y = input()

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

if x in groupA and y in groupA:
    print("Yes")
elif x in groupB and y in groupB:
    print("Yes")
elif x in groupC and y in groupC:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
g2 = [4, 6, 9, 11]
g3 = [2]

s = map(int, raw_input().split())

x = s[0]
y = s[1]

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: Runtime Error

Solution code:
import numpy as np
#from scipy.interpolate import interpld
from matplotlib import pyplot as plt
%matplotlib inline
import sys
x, y = [int(i) for i in input().split()]
list = [1,3,5,7,8,10,12,4,6,9,11,2,0]
slice1 = list[0:7]
slice2 = list[7:11]
slice3 = list[11:12]

if x in slice1 and y in slice1:
    print('Yes')
elif x in slice2 and y in slice2:
    print ('Yes')
elif x in slice3 and y in slice3:
    print ('Yes')
else:
    print ('No')

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

Solution code:
hw = raw_input().split(" ")
h = int(hw[0])
w = int(hw[1])
print("#"*(w+2))
for i in range(h):
    print("#" + raw_input() + "#")

print("#"*(w+2))

Submission status: Runtime Error

Solution code:

x = list(map(int, input().split()))
a=[input() for i in range(x[0])]

for i in range(x[1]):
    print('#',end="")
print('')
for i in a:
    print('#{0}#'.format(i))
for i in range(x[1]):
    print('#',end="")
print('')

Submission status: Runtime Error

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

H, W = map(int, input().split())
A = []
for i in range(H):
    A.append("#")
    a = input()
    A[i] += a + "#"

A = ["#" * (W+2)] + A + ["#" * (W+2)]

for i in A:
    print(i)

Submission status: Runtime Error

Solution code:
N = int(input())
array=[int(n) for n in input().split()]
lst=[]
for i in range(N+1):
    left_array=array[:N+i]
    print(left_array)
    l = sorted(left_array)[-N:]
    print('l:',l)
    right_array=array[N+i:]
    print(right_array)
    r = sorted(right_array)[:N]
    print('r:',r)
    ans = sum(l)-sum(r)
    print(ans)
    lst.append(ans)
print(max(lst))

Submission status: Runtime Error

Solution code:
h, w = [int(n) for n in input().split()]
i = min(h, w)
j = max(h, w)
area = i * j
if i % 3 == 0 or j % 3 == 0:
    print(0)
else:
    p = j // 3 + 1
    pp = i // 3 + 1
    q = j // 3 - 1
    qq = i // 3 - 1
    a1 = i * p
    aa1 = j * p
    a2 = i * q
    aa2 = j * q
    b1 = i // 2 * (j - p)
    bb1 = j // 2 * (i - p)
    b2 = i // 2 * (j - q)
    bb2 = j // 2 * (i - q)
    c1 = (j - p) // 2 * i
    cc1 = (i - p) // 2 * j
    c2 = (j - q) // 2 * i
    cc2 = (i - q) // 2 * j
    tup = [(a1, b1), (a2, b2), (aa1, bb1), (aa2, bb2),
        (a1, c1), (a2, c2), (aa1, cc1), (aa2, cc2)]
    lst = [abs(max(a, b, area - a - b) - min(a1, b1, area - a1 - b1))) for a, b in tup]
    print(min(lst))

Submission status: Runtime Error

Solution code:
h, w = [int(n) for n in input().split()]
i = min(h, w)
j = max(h, w)
area = i * j
if i % 3 == 0 or j % 3 == 0:
    print(0)
else:
    p = j // 3 + 1
    pp = i // 3 + 1
    q = j // 3 - 1
    qq = i // 3 - 1
    a1 = i * p
    aa1 = j * p
    a2 = i * q
    aa2 = j * q
    b1 = i // 2 * (j - p)
    bb1 = j // 2 * (i - p)
    b2 = i // 2 * (j - q)
    bb2 = j // 2 * (i - q)
    c1 = (j - p) // 2 * i
    cc1 = (i - p) // 2 * j
    c2 = (j - q) // 2 * i
    cc2 = (i - q) // 2 * j

    print(min(
        abs(max(a1, b1, area - a1 - b1) - min(a1, b1, area - a1 - b1))
        abs(max(aa1, bb1, area - aa1 - bb1) - min(aa1, b1, area - aa1 - bb1))
        abs(max(aa2, bb2, area - aa2 - bb2) - min(aa2, bb2, area - aa2 - bb2))
        abs(max(a2, b2, area - a2 - b2) - min(a2, b2, area - a2 - b2))
        abs(max(a1, c1, area - a1 - c1) - min(a1, c1, area - a1 - c1))
        abs(max(aa1, cc1, area - aa1 - cc1) - min(aa1, c1, area - aa1 - cc1))
        abs(max(aa2, cc2, area - aa2 - cc2) - min(aa2, cc2, area - aa2 - cc2))
        abs(max(a2, c2, area - a2 - c2) - min(a2, c2, area - a2 - c2))

    ))

Submission status: Runtime Error

Solution code:
ipt = input().split()

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
i=int(ipt[0])
j=int(ipt[1])
if i==j:
    print('Yes')
elif i in and j in a:
    print('Yes')
elif i in b and j in b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

if ipt[0] == ipt[1]:
    return True
else:
    if ipt[0] in a:
        return ipt[1] in a
    else:
        ipt[0] in b:
        return ipt[1] in b

Submission status: Runtime Error

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

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

groups = [group1, group_2, group_3]

for group in groups:
    if x, y in group:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

x, y = map(int, raw_input().split())
for i in range(0,1):
    if(group[i].count(x) > 0 and group[i].count(y) > 0):
        print("Yes")
        exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

l_1 = [1,3,5,7,8,10,12]
l_2 = [4,6,9,11]

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

if x == 2:
    if y == 2:
        print("yes")
    else:
        print("no")
elif x in l_1:
    if y in x_1:
        print("yes")
    else:
        print("no")
else x in l_2:
    if y in l_2:
        print("yes")
    else:
        print("no")

Submission status: Runtime Error

Solution code:
import sys

l_1 = [1,3,5,7,8,10,12]
l_2 = [4,6,9,11]

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

if x == 2:
    if y == 2:
        print("yes")
    else:
        print("no")
elif x in l_1:
    if y in x_1:
        print("yes")
    else:
        print("no")
else x in l_2:
    if y in l_2:
        print("yes")
    else:
        print("no")

Submission status: Runtime Error

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

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

if x == 2:
    if y == 2:
        print("yes")
    else:
        print("no")
elif x in l_1:
    if y in x_1:
        print("yes")
    else:
        print("no")
else x in l_2:
    if y in l_2:
        print("yes")
    else:
        print("no")

Submission status: Runtime Error

Solution code:
def f(a):
    if a==2:
        return 2
    if a==4:
        return 1
    if a==6:
        return 1
    if a==9:
        return 1
    if a==11:
        return 1
    return 0

x, y = map(int, raw_input().split());

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

Submission status: Runtime Error

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


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

if a[x] == a[y]:
    print("YES")
else:
    print("NO")
)

Submission status: Runtime Error

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

s=input()

print (str(a+b+c)+" "+s)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
import sys

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

input_x = int(sys.argv[1])
input_y = int(sys.argv[2])

exist_group1 = group1.count(input_x) + group1.count(input_y)
exist_group2 = group2.count(input_x) + group2.count(input_y)
exist_group3 = group3.count(input_x) + group3.count(input_y)

if exist_group1 == 2 or exist_group2 == 2 or exist_group3 == 2:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split());w+=2
print('#'*w)
for _ in[0]*h:print('#'+input()+'#')
print('#'*w)

Submission status: Runtime Error

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

x = int(input("x = "))
y = int(input("y = "))

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