#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;

const int N = 3e5+5;

#define pr(a) printf("%d",a); 
#define sc(a) scanf("%d",&a); 
#define lpr(a) printf("%lld",a); 
#define lsc(a) scanf("%lld",&a); 
#define br printf("\n");
#define INF 2e16
#define ll long long
#define pb push_back
#define MOD 1000000007

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

// order_of_key (val): returns the no. of values strictly less than val
// find_by_order (k): returns the kth largest element iterator.(0-based)
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

long long int arr[N];
int main(){
	int n,m;sc(n);sc(m);
	arr[0] = 1, arr[1] = 2;
	for(int i=2;i<=max(m,n);i++){
		arr[i] = (arr[i-1]+arr[i-2])%MOD;
	}
	ll ans=0;
	if(n==1){
		if(m==1) ans = 1;
		else{
			ans = (ans + arr[m-1])%MOD;
			// for(int j=m-1;j>0;j--){
			// 	ans = (ans + arr[j]%MOD);
			// }
		}
	}
	else if(m==1){
		if(n==1) ans = 1;
		else{
			ans = (ans + arr[n-1])%MOD;
			// for(int j=n-1;j>0;j--){
			// 	ans = (ans + arr[j]%MOD);
			// }
		}		
	}
	else{
		if(n>3) ans = (ans + arr[n-3])%MOD;
		else ans = (ans + 1)%MOD;
		// trace(ans);
		if(m>3) ans = (ans + arr[m-3])%MOD;
		else ans = (ans + 1)%MOD;
		ans = (ans + arr[m-2])%MOD;
		ans = (ans + arr[n-2])%MOD;
		ans = (ans - 1 + MOD)%MOD;
		// trace(ans);
		// int k = max(m,n) - 2;
		// if(k<=0) ans = (ans+1)%MOD;
		// else ans = (ans + arr[k])%MOD;
		// for(int j=k;j>0;j--){
		// 	ans = (ans + arr[j]%MOD);
		// 	trace(j, ans);
		// }
	}
	ans*=2;
	lpr(ans);br;
	return 0;
}
ll power(ll a,ll b)
{
	ll r=1;
	while(b){
		if(b & 01) r=(r*a)%MOD;
		a=(a*a)%MOD;
		b>>=1;
	}
	return r;
}


