import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  int x, y;
  readf("%s %s\n", &x, &y);

  auto a = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]];

  bool f;
  foreach (i; 0..3) {
    if (a[i].canFind(x) && a[i].canFind(y)) {
      f = true;
    }
  }
  if (f) {
    writeln("Yes");
  } else {
    writeln("No");
  }
}
