foldBool :: [Int] -> [Int] -> Bool                                                                                                                                          
foldBool [a, b] list = (foldr (||) False (map (==a) list)) && (foldr (||) False (map (==b) list))
  
main = do
  [a, b] <- map read . words <$> getLine
  if (foldBool [a, b] list1) || (foldBool [a, b] list2)
    then putStrLn "Yes"
    else putStrLn "No"
  where
    list1 = [1, 3, 5, 7, 8, 10, 12] 
    list2 = [4, 6, 9, 11]