#include <bits/stdc++.h>
using namespace std;
long long mod_pow(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % 1000000007;
    x = x * x % 1000000007;
    n >>= 1;
  }
  return res;
}
long long n, m;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long k = max(n, m);
  vector<vector<long long>> dp(k + 1, vector<long long>(2, 0));
  dp[1][0] = 2;
  for (long long i = (long long)(1); i < (long long)(k); i++)
    for (long long j = (long long)(0); j < (long long)(2); j++) {
      if (j + 1 < 2) (dp[i + 1][j + 1] += dp[i][j]) %= 1000000007;
      (dp[i + 1][0] += dp[i][j]) %= 1000000007;
    }
  long long nrest = (dp[n][0] + dp[n][1] - 2 + 1000000007) % 1000000007;
  long long mrest = (dp[m][0] + dp[m][1]) % 1000000007;
  mrest *= mod_pow(2, 1000000007 - 2);
  mrest %= 1000000007;
  cout << (2 * mrest + nrest) % 1000000007 << endl;
  return 0;
}
