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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
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)

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

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

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

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    INF = float("inf")
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

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

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

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

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

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

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

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

Solution (Python):
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)

Solution (Python):

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

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

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

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

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

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

Solution (Python):
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())

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

Solution (Python):
[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")

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

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

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

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

Solution (Python):
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])

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

Solution (Python):
a,b,=map(int,input().split())
def c(a, b):
    if a==2 and b==2:
        return True
    s = {4,6,9,11}
    if a in s and b in s:
        return True
    s = {1,3,5,7,8,10,12}
    if a in s and b in s:
        return True
    return False
print('Yes' if c(a,b) else 'No')

Solution (Python):

x, y = map(int, input().split())
listi = [x, y]
list1 = [1, 3, 5, 7, 8, 10, 12]
list2 = [4, 6, 9, 11]
list3 = [2]

for i in listi:
    list1.append(i)
    list2.append(i)
    list3.append(i)

if len(set(list1)) == len(list1)-2 or len(set(list2)) == len(list2)-2 or len(set(list3)) == len(list3)-2:
    print("Yes")
else:
    print("No")

Solution (Python):
X, Y = map(int, input().split())
A = [2]
B = [4, 6, 9, 11]
C = [1, 3, 5, 7, 8, 10, 12]
print(["No", "Yes"][(X in A and Y in A)or(X in B and Y in B)or(X in C and Y in C)])

Solution (Python):
x,y=map(int,input().split())
a=[4,6,9,11]
if ((x in a)==(y in a)) and x!=2 and y!=2:
    ans='Yes'
else:ans='No'
print(ans)

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

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

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

if a.count(x) & a.count(y) or b.count(x) & b.count(y) or c.count(x) & c.count(y):
    print('Yes')
else:
    print('No')

Solution (Python):


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

if x == 2:
    x = "c"
elif x == 4 or x == 6 or x == 9 or x == 11:
    x = "b"
else:
    x = "a"

if y == 2:
    y = "c"
elif y == 4 or y == 6 or y == 9 or y == 11:
    y = "b"
else:
    y = "a"

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

Solution (Python):
g1 = ['2']
g2 = ['4','6','9','1']
g3 = ['1','3','5','7','8','10','12']
x, y = input().split()
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")

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

Solution (Python):
x,y = map(int,input().split())
 
if x == 2 or y == 2:
  print("No")
  exit()
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")

Solution (Python):
group = [ 0 for i in range(13) ]
group[2] = 1
for i in [4,6,9,11]:
    group[i]=2


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

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


x,y = LI()
f = [0,1,2,1,3,1,3,1,1,3,1,3,1]
if f[x] == f[y]:
    print("Yes")
else:
    print("No")



"""
h,w = LI()
ans = float("inf")
x = w//2
y = h//2
if not w%2:
    for i in range(1,h):
        if (h-i)%2 == 0:
            ans = min(ans,abs(w*i-w*(h-i)//2))
        ans = min(ans,abs(w*i-x*(h-i)))
else:
    for i in range(1,h):
        if (h-i)%2 == 0:
            ans = min(ans,abs(w*i-w*(h-i)//2))
        if w*i < x*(h-i):
            ans = min(ans,abs(w*i-(x+1)*(h-i)))
        elif w*i < (x+1)*(h-i):
            ans = min(ans,h-i)
        else:
            ans = min(ans,abs(w*i-x*(h-i)))
if not h%2:
    for i in range(1,w):
        if (w-i)%2 == 0:
            ans = min(ans,abs(h*i-h*(w-i)//2))
        ans = min(ans,abs(h*i-y*(w-i)))
else:
    for i in range(1,w):
        if (w-i)%2 == 0:
            ans = min(ans,abs(h*i-h*(w-i)//2))
        if h*i < y*(w-i):
            ans = min(ans,abs(h*i-(y+1)*(w-i)))
        elif h*i < (y+1)*(w-i):
            ans = min(ans,w-i)
        else:
            ans = min(ans,abs(h*i-y*(w-i)))
print(ans)
"""

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

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

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

Solution (Python):
g='XACABABAABABA'
x,y=map(int,input().split())
print(["No","Yes"][g[x]==g[y]])

Solution (Python):
def grouping(x: int, y: int)->bool:
    group = [
        [1, 3, 5, 7, 8, 10, 12],
        [4, 6, 9, 11],
        [2],
    ]
    for g in group:
        if x in g and y in g:
            return True
        elif x in g:
            return False
        elif y in g:
            return False
    return False


if __name__ == "__main__":
    x, y = map(int, input().split())
    yes = grouping(x, y)
    print('Yes' if yes else 'No')

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

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

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

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

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

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

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

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

Solution (Python):
d = {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())
print('YNeos'[d[x] != d[y]::2])

Solution (Python):
X, Y = map(int, input().split())
def check(a):
    if (a == 4 or a == 6 or a == 9 or a == 11):
        check_a = "A"
    elif a == 2:
        check_a = "B"
    else:
        check_a = "C"
    return check_a
  
if check(X) == check(Y):
    print('Yes')
else:
    print("No")

Solution (Python):
x, y = map(int, input().split())
G = [[1, 3, 5, 7, 8, 10, 12],
     [4, 6, 9, 11],
     [2]]
flag = 0
for i in range(3):
    for j in G[i]:
        if x == j:
            for k in G[i]:
                if y == k:
                    print('Yes')
                    flag = 1
if flag == 0:
    print('No')

Solution (Python):
x,y = [int(x) for x in input().split()]
li = [0,2,0,1,0,1,0,0,1,0,1,0]
if(li[x-1] == li[y-1]):
  print('Yes')
else:
  print('No')

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

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

Solution (Python):

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:
	print('Yes' if y in list1 else 'No')
if x in list2:
	print('Yes' if y in list2 else 'No')
if x in list3:
	print('Yes' if y in list3 else 'No')

Solution (Python):
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]

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

ans = 'No'
if x in A and y in A:
    ans = 'Yes'
if x in B and y in B:
    ans = 'Yes'
if x in C and y in C:
    ans = 'Yes'

print(ans)

Solution (Python):
group_A = [1,3,5,7,8,10,12]
group_B = [4,6,9,11]
group_C = [2]
x,y = map(int,input().split())
if(x in group_A):
    if(y in group_A):
        print("Yes")
    else:
        print("No")
elif(x in group_B):
    if(y in group_B):
        print("Yes")
    else:
        print("No")
else:
    if(y in group_C):
        print("Yes")
    else:
        print("No")

Solution (Python):

x, y = map(int, input().split())
data = ['', 'a', 'c', 'a', 'b', 'a', 'b', 'a', 'a', 'b', 'a', 'b', 'a']
print('Yes' if data[x] == data[y] else 'No')

Solution (Python):
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]==a[y] else "No")

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

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

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

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

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

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

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

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

Solution (Python):

x, y = map(int, input().split())
if(x==2 or y==2):
    if(x==y):
        print("Yes")
    else:
        print("No")

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

Solution (Python):
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]:
        if (x in c)*(y in c):
            ans='Yes'
            break
if ans=='': ans='No'
print(ans)

Solution (Python):

def func(a, b):
    g1 = [1, 3, 5, 7, 8, 10, 12]
    g2 = [4, 6, 9, 11]
    result = 'Yes' if (A in g1 and B in g1) or (A in g2 and B in g2) else 'No'
    return result

A, B = map(int, input().split())

print(func(A, B))

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

Solution (Python):
a=[0,1,2,1,3,1,3,1,1,3,1,3,1]
x,y=(int(x) for x in input().split())

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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
m=[1,3,1,2,1,2,1,1,2,1,2,1]
a,b=map(int,input().split())    
if m[a-1]==m[b-1]:
  print("Yes")
else:
  print("No")

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

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

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

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

res = 'No'
for g in groups:
    if x in g and y in g:
        res = 'Yes'

print(res)

Solution (Python):
x, y = map(int,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) or (x in B and y in B) or (x in C and y in C)):
  ans = "Yes"
print(ans)

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

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

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

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

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

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

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

if (x in A):
    xg = 0
elif (x in B):
    xg = 1
else:
    xg = 2
if (y in A):
    yg = 0
elif (y in B):
    yg = 1
else:
    yg = 2

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

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

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

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

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

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

Solution (Python):
from sys import stdin
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if a == b:
  print('Yes')
elif a in g1 and b in g1:
  print('Yes')
elif a in g2 and b in g2:
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):
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 == 2 and y == 2:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):

group = [[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 group[i]:
        x = i
    if y in group[i]:
        y = i
print(['No', 'Yes'][x == y])

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

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

Solution (Python):

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

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

Solution (Python):
import sys
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')
		sys.exit()
print('No')

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

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

ans = 'No'
for a in A:
    if x in a and y in a:
        ans = 'Yes'
        
print(ans)

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

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

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

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

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

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

if((x in A and y in A) or (x in B and y in B) or x == y == 2):
  print('Yes')
else:
  print('No')

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

def group(x):
    g = {
        0: set([1, 3, 5, 7, 8, 10, 12]),
        1: set([4, 6, 9, 11]),
        2: set([2])
    }
    for k in g.keys():
        if x in g[k]:
            return k
    return len(g)
ans = group(x) == group(y)

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

Solution (Python):
G1 = [1,3,5,7,8,10,12]
G2 = [4,6,9,11]
G3 = [2]
X,Y = map(int,input().split())
if X in G1 and Y in G1: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')

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

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

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

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

list1 = {1,3,5,7,8,10,12}
list2 = {4,6,9,11}
list3 = {2}
result = "No"

set_list = [list1,list2,list3]
for data in set_list:
    if x in data:
        if y in data:
            result = "Yes"

print(result)

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

if ({x, y} & {4, 6, 9, 11} == {x, y}) or ({x, y} & {1, 3, 5, 7, 8, 10, 12} == {x, y}):
    print('Yes')
else:
    print('No')