let group x =
	if List.exists ((=) x) [1; 3; 5; 7; 8; 10; 12] then
		`A
	else if List.exists ((=) x) [4; 6; 9; 11] then
		`B
	else
		`C

let () =
	let x, y = Scanf.scanf "%d %d" (fun x y -> (x, y)) in
	if group x = group y then
		Printf.printf "Yes\n"
	else
		Printf.printf "No\n"
