'use strict';

var main = input => {
    // const [x, y] = input.split(" ").map(e => parseInt(e));
    const array = input.split(" ").map(e => parseInt(e));
    const x = array[0], y = array[1];
    const group1 = [1, 3, 5, 7, 8, 10, 12],
        group2 = [4, 6, 9, 11];
    let same = false;
    same |= group1.indexOf(x) !== -1 && group1.indexOf(y) !== -1;
    same |= group2.indexOf(x) !== -1 && group2.indexOf(y) !== -1;
    console.log(same ? "Yes" : "No");
}

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