import Control.Applicative
import Data.Bool (bool)

main :: IO ()
main = solve <$> f >>= putStrLn
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> String
solve [x, y] = bool "No" "Yes" $ tbl !! x == tbl !! y
  where
    tbl = [0,0,2,0,1,0,1,0,0,1,0,1,0]
