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