#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n, m, M, p = 1000000007;
  cin >> n >> m;
  M = max(n, m);
  M++;
  long long int s, d = 2;
  long long int dp[M];
  dp[0] = 2;
  for (long long int i = 1; i < M; i++) {
    s = d % p;
    d = dp[i - 1] % p;
    dp[i] = (s + d) % p;
  }
  long long int res = (dp[m - 1] + dp[n - 1] - 2) % p;
  cout << res << endl;
}
