"use strict";
const Main =  (input) => {
	let xs = input.trim().split(' ').map(v=>parseInt(v,10));
    let x = [1,3,5,7,8,10,12];
    let y = [4,6,9,11];
    let z = [2];
    
    if(x.indexOf(xs[0]) != -1 && x.indexOf(xs[1]) != -1 || y.indexOf(xs[0]) != -1 && y.indexOf(xs[1]) != -1 || z.indexOf(xs[0]) != -1 && z.indexOf(xs[1]) != -1){
      console.log('Yes');
    }else{
      console.log('No'); 
    }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));