function Main(input) {
	inp = input.split(" ")
	var x = parseInt(inp[0])
	var y = parseInt(inp[1])
	var a = [1,3,5,7,8,10,12]
	var b = [4,6,9,11]

	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", "utf8"));
