#include <bits/stdc++.h>
using namespace std;
void dynamic() {
  int n, m;
  cin >> n >> m;
  int n1 = max(n, m);
  long long int dp[n1 + 1][2][2];
  if (n == 1 && m == 1) {
    cout << "2"
         << "\n";
    return;
  }
  memset(dp, 0, sizeof(dp));
  dp[1][0][0] = 1;
  dp[2][0][0] = 1;
  dp[1][0][1] = 1;
  dp[2][0][1] = 1;
  dp[1][1][1] = 0;
  dp[2][1][1] = 1;
  dp[1][1][0] = 0;
  dp[2][1][0] = 1;
  for (int i = 3; i <= max(n, m); i++) {
    dp[i][1][0] =
        (dp[i - 1][0][0] % 1000000007 + dp[i - 1][0][1] % 1000000007) %
        1000000007;
    dp[i][1][1] = dp[i - 1][1][0] % 1000000007;
    dp[i][0][0] = dp[i - 1][0][1] % 1000000007;
    dp[i][0][1] =
        (dp[i - 1][1][1] % 1000000007 + dp[i - 1][1][0] % 1000000007) %
        1000000007;
  }
  long long int ans = (dp[n][1][0] % 1000000007 + dp[n][1][1] % 1000000007 +
                       dp[n][0][0] % 1000000007 + dp[n][0][1] % 1000000007) %
                      1000000007;
  ans += (dp[m][1][0] % 1000000007 + dp[m][1][1] % 1000000007 +
          dp[m][0][0] % 1000000007 + dp[m][0][1] % 1000000007) %
         1000000007;
  ans %= 1000000007;
  ans -= 2;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    dynamic();
  }
}
