groupcheck::Int->Int->String
groupcheck x y 
    |elem x a && elem y a = "Yes"
    |elem x b && elem y b = "Yes"
    |elem x c && elem y c = "Yes"
    |otherwise = "No"
    where
        a = [1,3,5,7,8,10,12]
        b = [4,6,9,11]
        c = [2]

main::IO ()
main = do
    [a,b] <- map read . words <$> getLine::IO[Int]
    putStrLn $ groupcheck a b
