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

solve:: Int -> Int -> String
solve x y
  | x == 2 = "No"
  | y == 2 = "No"
  | xa && ya = "Yes"
  | not xa && not ya = "Yes"
  | otherwise = "No"
  where
    a = [1, 3, 5, 7, 8, 10, 12]
    xa = elem x a
    ya = elem y a