#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7, maxn = 1e6 + 10;
int n, m, dp[maxn];
int main() {
  cin >> n >> m;
  dp[1] = 2;
  dp[2] = 4;
  for (int i = 3; i < maxn; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % M;
  }
  int ans = (dp[n] + dp[m]) % M;
  ans = (M + ans - 2) % M;
  cout << ans << endl;
}
