import std.stdio;
import std.string;
import std.conv;
import std.algorithm: canFind;

void main() {
	string[] inputs = split(readln());
	int x = to!int(inputs[0]);
	int y = to!int(inputs[1]);
	
	int[] g1 = [1, 3, 5, 7, 8, 10, 12];
	int[] g2 = [4, 6, 9, 11];
	
	if(canFind(g1, [x, y]) || canFind(g2, [x, y]) || (x == y && x == 2))
		"Yes".writeln;
	else "No".writeln;
}
