groups :: [[Int]]
groups = [ [1, 3, 5, 7, 8, 10, 12]
         , [4, 6, 9, 11]
         , [2]
         ]

main :: IO ()
main = do
  [x, y] <- mapM readIO . words =<< getLine
  if any (\g -> elem x g && elem y g) groups
    then putStrLn "Yes"
    else putStrLn "No"
