import Control.Applicative
import Data.List
import Data.Char

getInt :: IO Integer
getInt = (\a -> read a :: Integer) <$> getLine

getIntArray :: IO [Integer]
getIntArray = ((map (\a -> read a :: Integer)) . words) <$> getLine

getStrArray :: Integer -> IO [String]
getStrArray 0 = return [] :: IO [String]
getStrArray n = (:) <$> getLine <*> (getStrArray (n - 1))

groupI :: Integer -> Char
groupI 2 = 'C'
groupI 4 = 'B'
groupI 6 = 'B'
groupI 9 = 'B'
groupI 11 = 'B'
groupI _ = 'A'

main = do
    [x, y] <- getIntArray
    putStrLn (if (groupI x) == (groupI y) then "Yes" else "No")
