"use strict";
// inputに入力データ全体が入る
const main = (input) => {
  const [x, y] = input.trim().split(" ").map(Number);
  const g1 = [1, 3, 5, 7, 8, 10, 12];
  const g2 = [4, 6, 9, 11];
  const g3 = [2];
  return (g1.includes(x) && g1.includes(y)) ||
    (g2.includes(x) && g2.includes(y)) ||
    (g3.includes(x) && g3.includes(y))
    ? "Yes"
    : "No";
};

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
console.log(main(require("fs").readFileSync("/dev/stdin", "utf8")));
