#include <bits/stdc++.h>
using namespace std;
static const int N = 1e5 + 10;
static const long long mod = 1e9 + 7;
long long dp[N][2][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  ;
  int n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  dp[1][1][1] = 1;
  dp[1][0][0] = 1;
  dp[1][1][0] = 0;
  dp[1][0][1] = 0;
  for (int i = 2; i < n; ++i) {
    dp[i][0][0] = dp[i - 1][0][1];
    dp[i][0][1] = (dp[i - 1][1][1] + dp[i - 1][1][0]) % mod;
    dp[i][1][0] = (dp[i - 1][0][1] + dp[i - 1][0][0]) % mod;
    dp[i][1][1] = dp[i - 1][1][0];
  }
  long long ans = 0;
  dp[0][0][1] = 1;
  for (int i = 2; i <= n; ++i) {
    long long cur = (dp[i - 2][0][1] + dp[i - 2][1][1]);
    ans = (ans + cur) % mod;
  }
  for (int i = 2; i <= m; ++i) {
    ans = (ans + dp[i - 2][0][1] + dp[i - 2][1][1]) % mod;
  }
  cout << (ans * 2LL + 2LL) % mod << "\n";
}
