#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("trapv")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
const int N = 1e6 + 40;
const int MAXK = 12;
const unsigned long long int INF = 1000000000000000000;
const int RANDOM =
    chrono::high_resolution_clock::now().time_since_epoch().count();
unsigned long long int expo_pow(unsigned long long int x,
                                unsigned long long int y) {
  if (y == 0) return 1;
  y = y % ((1000000007) - 1);
  x %= (1000000007);
  if (y == 0) y = (1000000007) - 1;
  unsigned long long int res = 1;
  while (y) {
    if (y & 1) res = (res * x) % (1000000007);
    x = (x * x) % (1000000007);
    y >>= 1;
  }
  return res;
}
unsigned long long int modInverse(unsigned long long int a,
                                  unsigned long long int m = (1000000007)) {
  return expo_pow(a, m - 2);
}
void solve() {
  unsigned long long int n, m;
  cin >> n >> m;
  unsigned long long int dp[max(n, m) + 1];
  dp[1] = 2, dp[2] = 4;
  for (int i = (3); i < (max(n, m) + 1); i++) {
    dp[i] =
        (dp[i - 1] % (1000000007) + dp[i - 2] % (1000000007)) % (1000000007);
  }
  cout << (dp[n] + dp[m] - 2) % (1000000007) << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  while (T--) {
    solve();
  }
}
