function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);
  const g = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1];
 console.log(g[a[0]]==g[a[1]]?"Yes":"No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));