main = do
  [x, y] <- map read . words <$> getLine
  putStr $ f x y
 
a = [1, 3, 5, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
 
f x y
  | elem x a && elem y a = "Yes"
  | elem x b && elem y b = "Yes"
  | elem x c && elem y c = "Yes"
  | otherwise = "No"