#include <iostream>
#include <iomanip>
#include<vector>
#include <algorithm>
#include <queue>
#include<string>
#include <map>
#include <cmath>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <utility>
#include <set>
#include <bitset>
typedef long long ll;
typedef long double ld;
#define PI  3.14159265358979323846

#define REP(i,s,n)for(ll i=s;i<(n);++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
string S;
ll N, M;
vector<string>A;
int Bingo[3][3] = {};

int main() {
    cin >> N>>M;
    ll maxNM = max(N,M);
    ll minNM = min(N,M);
    minNM += 3;
    if (maxNM<minNM) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
using namespace std; 
const int mo=1e9+7;
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while('0'>s||s>'9'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
} 
int n,v1,v2,v3,v4;
int add(int x,int y){return x+y>mo?x+y-mo:x+y;}
int solve1(int x){
	int res=1;
	for(int i=1;i<x-2;i++)res=add(res,res);
	return res;
}
int solve2(int x){
	int f1=1,f2=1;
	for(int i=1;i<x-2;i++)f1=add(f1,f2),f2=add(f1,mo-f2);
	return f1;
}
int main(){
	read(n);char ch;
	scanf("\n%c",&ch);v1=(ch=='A');
	scanf("\n%c",&ch);v2=(ch=='A');
	scanf("\n%c",&ch);v3=(ch=='A');
	scanf("\n%c",&ch);v4=(ch=='A');
	if(v1&&v2&&v3&&v4)puts("1");
	if(v1&&v2&&v3&&!v4)puts("1");
	if(v1&&v2&&!v3&&v4)puts("1");
	if(v1&&v2&&!v3&&!v4)puts("1");
	if(v1&&!v2&&v3&&!v4)puts("1");
	if(!v1&&!v2&v3&&!v4)puts("1");
	if(v1&&!v2&&!v3&&!v4)puts("1");
	if(!v1&&!v2&&!v3&&!v4)puts("1");
	if(v1&&!v2&&v3&&v4)printf("%d\n",solve1(n));
	if(!v1&&v2&&v3&&v4)printf("%d\n",solve2(n));
	if(!v1&&v2&&!v3&&v4)printf("%d\n",solve1(n));
	if(!v1&&v2&&!v3&&!v4)printf("%d\n",solve1(n));
	if(!v1&&!v2&&v3&&v4)printf("%d\n",solve1(n));
	if(v1&&!v2&&!v3&&v4)printf("%d\n",solve2(n));
	if(!v1&&v2&&v3&&!v4)printf("%d\n",solve2(n));
	if(!v1&&!v2&&!v3&&v4)printf("%d\n",solve2(n));
	return 0;
}