data Group = A | B | C deriving (Eq)

main:: IO ()
main = do
    [x,y] <- (map read . words) <$> getLine
    putStrLn $ if solve (x,y) then "Yes" else "No"

-- |
solve :: (Int,Int) -> Bool
solve (x,y) = grouping x == grouping y

grouping :: Int -> Group
grouping x
  | x `elem` [4,6,9,11] = A
  | x == 2              = B
  | otherwise           = C
