function pint(s)   { return parseInt(s);   }                                                                                                                                                                                                                                                                                  function pfloat(s) { return parseFloat(s); }                                                                                                                                                                                                                                                                                  function even(s)   { return (s % 2) === 0; }                                                                                                                                                                                                                                                                                  function odd(s)    { return (s % 2) === 1; }                                                                                                                                                                                                                                                                                  Array.prototype.sortNumAsc  = function ()  { return this.sort((a, b) => (a - b)); }                                                                                                                                                                                                                                           Array.prototype.sortNumDesc = function ()  { return this.sort((a, b) => (b - a)); }                                                                                                                                                                                                                                           Array.prototype.sortStrAsc  = function ()  { return this.sort();                  }                                                                                                                                                                                                                                           Array.prototype.sortStrDesc = function ()  { return this.sort().reverse();        }                                                                                                                                                                                                                                           Array.prototype.without     = function (x) { return this.filter(e => e !== x);    }                                                                                                                                                                                                                                           function main(lines) {                                                                                                                                                                                                                                                                                                          var a = [1,3,5,7,8,10,12];
  var b = [4,6,9,11];                                                                                                                                                                                                                                                                                                           var c = [2];                                                                                                                                                                                                                                                                                                                  var ar = lines[0].split(' ').map(pint);
  var x = ar[0];
  var y = ar[1];
  if ((~a.indexOf(x) && ~a.indexOf(y)) ||
      (~b.indexOf(x) && ~b.indexOf(y))) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}                                                                                                                                                                                                                                                                                                                             main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n').map(l => l.trim()));