#include <bits/stdc++.h>
using namespace std;
const int64_t M = 1e9 + 7;
int32_t main() {
  int64_t n, m;
  cin >> n >> m;
  vector<int64_t> dp(max(n, m) + 1, 0);
  dp[1] = 1;
  dp[2] = 2;
  for (int64_t i = 3; i <= max(n, m); i++) dp[i] = (dp[i - 1] + dp[i - 2]) % M;
  int64_t ans = (dp[n] * 2 + dp[m] * 2) - 2;
  cout << ans % M;
}
