main :: IO ()
main = putStr . solve =<< map read . words <$> getLine

solve :: [Int] -> String
solve [x, y]
    | elem x g1 && elem y g1 = "Yes"
    | elem x g2 && elem y g2 = "Yes"
    | elem x g3 && elem y g3 = "Yes"
    | otherwise = "No"

g1 :: [Int]
g1 = [1, 3, 5, 7, 8, 10, 12]

g2 :: [Int]
g2 = [4, 6, 9, 11]

g3 :: [Int]
g3 = [2]