program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32)x,y
    integer(int32):: g(12) = [0,2,0,1,0,1,0,0,1,0,1,0]

    read*, x,y

    if (g(x)==g(y)) then
        print'(a)', 'Yes'
    else
        print'(a)', 'No'
    end if
    

end program main