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



listA = [1, 3, 5, 7 , 8 , 10 , 12]

listB = [4 , 6, 9, 11]

listC=[2]



if x in listA and y in listA:

    print("Yes")

    

elif x in listB and y in listB:

    print("Yes")

    

elif x in listC and y in listC:

    print("Yes")

    

else:

    print("No")
x,y =list(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")

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

x, y = list(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")

-listA = [1, 3, 5, 7, 8, 10, 12] -listB = [4, 6, 9, 11] -listC = [2] -if x in listA and y in listA: +L1 = [1, 3, 5, 7, 8, 10, 12] +L2 = [4, 6, 9, 11] +L3 = [2] +if x in L1 and y in L1: -elif x in listB and y in listB: +elif x in L2 and y in L2: -elif x in listC and y in listC: +elif x in L3 and y in L3: