import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

bool calc(int x, int y) {
    if (x == 2 || y == 2) return false;

    auto a = [1, 3, 5, 7, 8, 10, 12];
    auto b = [4, 6, 9, 11];
    if (a.canFind(x) && a.canFind(y)) return true;
    if (b.canFind(x) && b.canFind(y)) return true;
    return false;
}

void main() {
    auto xy = readints;
    int x = xy[0], y = xy[1];

    writeln(calc(x, y) ? "Yes" : "No");
}
