let id x = x
let (x,y) = Scanf.scanf "%d %d" (fun x y -> (x,y))
 
let alist = [1;3;5;7;8;10;12]
let blist = [4;6;9;11]
          
let ans = if x=2 || y=2 then false else
            if List.mem x alist then List.mem y alist
            else List.mem y blist

let ans' = if ans then "Yes" else "No"
 
let () = Printf.printf "%s\n" ans'