#include <bits/stdc++.h>
using namespace std;
const int Size = 1024;
const int mod = 1e9 + 7;
const int mod2 = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 3e5 + 15;
const int base = 307;
long long dp[maxn];
int main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  dp[1] = 2;
  dp[2] = 4;
  for (long long i = 3; max(n, m) >= i; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  printf("%lld\n", (dp[n] + dp[m] - 2) % mod);
  return 0;
}
