void main() {
    int[] xy = readln.split.to!(int[]);
    int x = xy[0], y = xy[1];
    bool ok = true;
    int[] d30 = [4, 6, 9, 11];
    if (xy.any!"a == 2") {
        ok = false;
    } else if (d30.canFind(x) != d30.canFind(y)) {
        ok = false;
    }
    writeln(ok ? "Yes" : "No");
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;