import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromJust)
import Control.Monad
import Data.List

getGroup :: Int -> Int
getGroup 2 = 2
getGroup x
    | elem x [4, 6, 9, 11] = 1
    | otherwise = 0

solve :: Int -> Int -> String
solve x y
    | (getGroup x) == (getGroup y) = "Yes"
    | otherwise = "No"


main :: IO ()
main = do
    [x, y] <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
    putStrLn $ solve x y
