function Main(input) {
	input = input.split('\n');
	var x = parseInt(input[0],10);
	var y = parseInt(input[1],10);
	var a = [1,3,5,7,8,10,12];
	var b = [4,6,9,11];
	var c = [2]

	if (x==2 && y==2){
		console.log("Yes");
	}
	else if (a.indexOf(x)>=0 && a.indexOf(y)>=0){
		console.log("Yes");
	}
	else if (b.indexOf(x)>=0 && b.indexOf(y)>=0){
		console.log("Yes");
	}
	else{
		console.log("No");
	}
	
}
//Main(require("fs").readFileSync("/dev/stdin/in.txt", "utf8"));
Main(require("fs").readFileSync("/dev/stdin/", "utf8"));