import Data.List

a1 = [4,6,9,11]

main = do
  [x,y] <- map read . words <$> getLine
  putStrLn $ solve x y

solve :: Int -> Int -> String
solve x y
  | tt x == tt y = "Yes"
  | otherwise = "No"

tt :: Int -> Int
tt 2 = 0
tt x
  | t == Nothing = 2
  | otherwise = 1
    where t = find (x==) a1



