main :: IO ()
main = do
    [x,y] <- map read . words <$> getLine :: IO [Int]
    let a = [1,3,5,7,8,10,12]
        b = [4,6,9,11]
        c = [2]
    putStrLn $ if (elem x a && elem y a) || (elem x b && elem y b) then "Yes" else "No"
