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

void main() {
  int[] g1 = [1,3,5,7,8,10,12],
        g2 = [4,6,9,11],
        g3 = [2];
  int[] xy = readln.chomp.split.to!(int[]);
  int x = xy[0],
      y = xy[1];

  bool found;

  foreach (g; [g1, g2, g3]) {
    if ([x, y].all!(e1 => g.canFind(e1))) {
      found = true;
      break;
    }
  }

  writeln(found ? "Yes" : "No");
}
