import Control.Monad

same a b g = elem a g && elem b g

main = do
  [a, b] <- (map read . words) <$> getLine :: IO [Int]
  let g1 = [1, 3, 5, 7, 8, 10, 12]
  let g2 = [4, 6, 9, 1]
  let g3 = [2]

  putStrLn $ if same a b g1 || same a b g2 || same a b g3 then "Yes" else "No"
