#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
const long long MOD = 1e9 + 696969;
const long long INF = 1e18;
int n, m, k, a, b, c;
const int maxn = 1001000;
long long dp[maxn][2];
int main() {
  cin >> n >> m;
  dp[1][0] = 2;
  dp[2][0] = 2;
  dp[2][1] = 2;
  for (int i = 3; i <= n + m; ++i) {
    dp[i][1] = (dp[i - 2][0]) % mod;
    dp[i][0] = (dp[i - 1][1] + dp[i - 1][0]) % mod;
  }
  long long ret = dp[n + m - 1][0] + dp[n + m - 1][1];
  cout << ret % mod;
}
