import std.stdio, std.string, std.conv, std.range, std.array, std.algorithm;
import std.uni, std.math, std.container, std.typecons, std.typetuple;
import core.bitop, std.datetime;

immutable int mod = 10^^9 + 7;

void main()
{
    //             0  1  2  3  4  5  6  7  8  9  10 11 12
    int[] group = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1];
    int x, y;
    readVars(x, y);

    writeln(group[x] == group[y] ? "Yes" : "No");
}


void readVars(T...)(auto ref T args)
{
    auto line = readln.split;
    foreach(ref arg ; args){
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    if(!line.empty){
        writeln(line);
        throw new Exception("args num < input num");
    }
}