a = [1, 3, 5, 7, 8, 10, 12];
b = [4, 6, 9, 11];
c = [2];
z = [];

var readline = require('readline');

var rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout
});

rl.question('', function(x)
{
	first = parseInt(x.substring(0, 1));
	second = parseInt(x.substring(2, 3));

	if(a.includes(first))
		z = a;
	else if(b.includes(first))
		z.push(b);
	else if(c.includes(first))
		z.push(c);


	if(z.includes(second))
		console.log("Yes");
	else
		console.log("No");

	rl.close();
	process.stdin.destroy();
});