const main = input => {
  const [x, y] = input.trim().split(' ').map(x => parseInt(x))
  const group = {
    1: 1,
    2: 3,
    3: 1,
    4: 2,
    5: 1,
    6: 2,
    7: 1,
    8: 1,
    9: 2,
    10: 1,
    11: 2,
    12: 1,
  }

  if (group[x] === group[y]) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
