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