function Main(input) {
	input = input.trim().split(" ").map((a)=>Number(a));
  var list1 = [2];
  var list2 = [1,3,5,7,8,10,12];
  var list3 = [4,6,9,11];
  if((list1.indexOf(input[0]) != -1 && list1.indexOf(input[1]) != -1) || 
    (list2.indexOf(input[0]) != -1 && list2.indexOf(input[1]) != -1) || 
    (list3.indexOf(input[0]) != -1 && list3.indexOf(input[1]) != -1)){
     console.log("Yes");
     }else{
      console.log("No"); 
     }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
