import Data.List
import Data.Bool
import Data.Maybe

main = putStrLn . bool "No" "Yes" . solve . map read . words =<< getLine

solve :: [Int] -> Bool
solve xs = a == b
  where
    gs = [[1, 3, 5, 7, 8, 10, 12],
          [4, 6, 9, 11],
          [2]]
    [a, b] = map (\x -> fromJust $ findIndex (elem x) gs) xs
