'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ').map(n => Number(n));

  const a = s[0];
  const b = s[1];

  const set1 = new Set([1, 3, 5, 7, 8, 10, 12]);
  const set2 = new Set([4, 6, 9, 11]);
  const set3 = new Set([2]);

  const has1 = set1.has(a) && set1.has(b);
  const has2 = set2.has(a) && set2.has(b);
  const has3 = set3.has(a) && set3.has(b);

  const ans = (has1 || has2 || has3) ? 'Yes' : 'No';

  console.log(ans);
}

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