function Main(input){
  input = input.split(' ');
  var x = Number(input[0]);
  var y = Number(input[1]);

  var group_a = [1,3,5,7,8,10,12];
  var group_b = [4,6,9,11];
  var group_c = [2];

  if( group_a.indexOf(x) > -1 && group_a.indexOf(y) > -1 || 
  group_b.indexOf(x) > -1 && group_b.indexOf(y) > -1 ||
  group_c.indexOf(x) > -1 && group_c.indexOf(y) > -1) {
      console.log('Yes');
  } else {
      console.log('No');
  }

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