"use strict"

function main(input) {

  input = input.split(' ').map(v => ~~v)
  const x = input[0]
  const y = input[1]
  const a = [1, 3, 5, 7, 8, 10, 12]
  const b = [4, 6, 9, 11]
  // const c = [2]

  // console.log(a.indexOf(x), a.indexOf(y), b.indexOf(x), b.indexOf(y))
  if ((a.indexOf(x) >= 0 && a.indexOf(y) >= 0) ||
    (b.indexOf(x) >= 0 && b.indexOf(y) >= 0)) {
    console.log('Yes')
    return
  }
  console.log('No')
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));