open List;;
Scanf.scanf "%d %d" @@ fun x y -> print_endline @@
  if x = 2 || y = 2 then "No"
  else if exists (fun g -> mem x g && mem y g) [[1; 3; 5; 7; 8; 10; 12]; [4; 6; 9; 11]] then "Yes"
  else "No"