import std.stdio, std.conv, std.string;

void main(){
	auto ip = readln.split.to!(int[]), x = ip[0], y = ip[1];
	const gr = [0, 1, 2, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1];
	if(gr[x] == gr[y]){
		writeln("Yes");
	} else {
		writeln("No");
	}
}