#include<stdio.h>
#include<string.h>
#include<string>
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

vector<int>v1,v2,v3;

int main()
{
    int x,y;
    v1.push_back(1);
    v1.push_back(3);
    v1.push_back(5);
    v1.push_back(7);
    v1.push_back(8);
    v1.push_back(10);
    v1.push_back(12);
    v2.push_back(4);
    v2.push_back(6);
    v2.push_back(8);
    v2.push_back(11);
    while(scanf("%d %d", &x,&y)==2)
    {
        if( x==2 || y==2 ) printf("No\n");
        else if( binary_search(v1.begin(), v1.end(), x) && binary_search(v1.begin(), v1.end(), y))
        {
            printf("Yes\n");
        }
        else if( binary_search(v2.begin(), v2.end(), x) && binary_search(v2.begin(), v2.end(), y) )
        {
            printf("Yes\n");
        }
        else printf("No\n");
    }


    return 0;
}

