function main(input) {
  input = input.trim();
  const [a,b] = input.split(" ").map(Number);
  const x = [1,3,5,7,8,10,12];
  const y = [4,6,9,11];
  const z = [2];
  if((x.includes(a)&&x.includes(b))||(y.includes(a)&&y.includes(b))||(z.includes(a)&&z.includes(b))){
    console.log("Yes");
  }else{
    console.log("No");
  }
    
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));