import std.stdio;
import std.string;
import std.array;

void main(){
	auto group = [[1,3,5,7,8,10,12],[4,6,9,11],[2]];
	int x,y;
	readf("%d %d", x, y);
	foreach(int[] a; group){
		int b = 0;
		foreach(int n; a){
			if(n == x || n == y){
				b++;
			}
		}
		if(b == 2){
			"Yes".writeln;
			return;
		}
	}
	"No".writeln;
}
