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