#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
long long dp[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  dp[0] = 2;
  dp[1] = 2;
  cin >> n >> m;
  for (int i = 2; i < N; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  long long ans = dp[n];
  for (int i = 0; i < m - 1; ++i) {
    ans += dp[i];
    ans %= MOD;
  }
  cout << ans % MOD;
  return 0;
}
