#include<iostream>
using namespace std;
int main(){
  int a,b,array[]={1,0,1,2,1,2,1,1,2,1,1,2,1};
  cin>>a>>b;
  if(array[a-1]==array[b-1]){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}