module Main where

import Control.Applicative
import Control.Monad
import Data.List

g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]

main :: IO ()
main = do
    [x, y] <- fmap read . words <$> getLine :: IO [Int]
    let b1 = and $ fmap (`elem` g1) [x, y]
    let b2 = and $ fmap (`elem` g2) [x, y]
    let b3 = and $ fmap (`elem` g3) [x, y]
    if or [b1, b2, b3]
        then putStrLn "Yes"
        else putStrLn "No"