let () = scanf "%d %d" (fun x y->
  if   ((x = 1 || x = 3 || x = 5 || x = 7 || x = 8 || x = 10 || x = 12)  &&
       (y = 1 || y = 3 || y = 5 || y = 7 || y = 8 || y = 10 || y = 12))
    || ((x = 4 || x = 6 || x = 9 || x = 11) &&
        ( y = 4 || y = 6 || y = 9 || y = 11))
    || (x = 2 && y = 2)
    then "Yes" else "No"
  ) |> printf "%s\n"