#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 2e9;
const long long maxn = 4e6 + 5;
const double Pi = acos(-1.0);
double Exp = 1e-6;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, m;
long long ans = 0;
long long dp[maxn];
signed main() {
  n = read(), m = read();
  long long mm = min(n, m);
  n = max(n, m);
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) {
    if (i == 1)
      dp[i] = 1;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  ans = (dp[n] + dp[mm] - 1) * 2 % mod;
  printf("%lld\n", ans);
  return 0;
}
