#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int mx = max(n, m);
  vector<long long int> dp(mx + 4, 0);
  dp[0] = 1;
  for (long long int i = 0; i < mx; i++) {
    dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
  }
  cout << ((dp[m] - 1 + dp[n] - 1 + 1) * 2) % mod << endl;
  return 0;
}
