#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  long long mod = 1e9 + 7;
  long long ans = 0;
  if (n > 1 || m > 1) {
    int N = max(m, n);
    vector<vector<vector<long long>>> dp(
        N, vector<vector<long long>>(2, vector<long long>(3, 0)));
    dp[0][0][1] = 1;
    dp[0][1][1] = 1;
    for (int i = 1; i < N; ++i) {
      dp[i][0][1] = (dp[i - 1][1][1] + dp[i - 1][1][2]) % mod;
      dp[i][0][2] = dp[i - 1][0][1];
      dp[i][1][1] = (dp[i - 1][0][1] + dp[i - 1][0][2]) % mod;
      dp[i][1][2] = dp[i - 1][1][1];
    }
    for (int c = 0; c < 2; ++c) {
      for (int k = 1; k < 3; ++k) {
        ans = (ans + dp[N - 1][c][k]) % mod;
      }
    }
    if (min(n, m) > 1) ans += 2;
  } else
    ans = 2;
  cout << ans << endl;
  return 0;
}
