import std.stdio, std.conv, std.string, std.algorithm, std.range, std.math;

void main() {
  alias f = a => a == 2 ? 0 : (a == 4 || a == 6 || a== 9 || a == 11) ? 1 : 2;
  auto po = readln.split.to!(int[]).map!f.array;
  writeln(po[0] == po[1] ? "Yes" : "No");
}
