inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0].split(' ')
x = inp.shift() * 1
y = inp.shift() * 1
if (x == 2 || y == 2) {
    ans = 'No'
} else if (
    (x == 4 || x == 6 || x == 9 || x == 11)
    &&
    (y == 4 || y == 6 || y == 9 || y == 11)
) {
    ans = 'Yes'
} else if (
    (x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12)
    &&
    (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12)
) {
    ans = 'Yes'
} else {
    ans = 'No'
}
console.log(ans)