#include <bits/stdc++.h>
using namespace std;
int n, m;
long long dp[1000006];
long long dp1[1000006][2];
int mod = 1000000007;
long long sol(int x) {
  if (x == 0) return 1;
  if (x < 0) return 0;
  if (dp[x] != -1) return dp[x];
  dp[x] = (sol(x - 2) + sol(x - 1)) % mod;
  return dp[x];
}
long long sol1(int x, int f) {
  if (x == 0)
    if (f == 0)
      return 1;
    else
      return sol(m);
  if (x < 0) return 0;
  if (dp1[x][f] != -1) return dp1[x][f];
  if (f == 1) {
    dp1[x][f] = sol1(x - 1, 1);
    dp1[x][f] = (dp1[x][f] + sol1(x - 2, 0) + sol(m));
  } else {
    dp1[x][f] = sol1(x - 1, 1);
    dp1[x][f] = (dp1[x][f] + sol1(x - 2, 0));
  }
  dp1[x][f] = dp1[x][f] % mod;
  return dp1[x][f];
}
int main() {
  scanf("%d %d", &n, &m);
  memset(dp1, -1, sizeof dp1);
  memset(dp, -1, sizeof dp);
  long long ans = (sol(n) - 1) + (sol(m) - 1) + 1;
  ans = ans * 2;
  cout << ans % mod << endl;
  return 0;
}
