main = do
  [x,y] <- map read . words <$> getLine
  let g = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
  let gx = map (or . map (==x)) g
  let gy = map (or . map (==y)) g
  putStrLn $ if gx==gy then "Yes" else "No"