import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)

readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

main = do
  xy <- readInts
  if or $ map (\c -> and $ map (flip elem c) xy) cs
    then putStr "Yes\n" 
    else putStr "No\n"
    where
      cs = [[1, 3, 5, 7, 8, 10, 12],
            [4, 6, 9, 11],
            [2]]
  
