#include <bits/stdc++.h>
using namespace std;
const int NM_MAX = 100002;
const long long MOD = 1e9 + 7;
int n, m;
long long dp[NM_MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  dp[0] = 1;
  for (int i = 1; i <= max(n, m); i++) {
    dp[i] = dp[i - 1];
    if (i >= 3) dp[i] = (dp[i] + dp[i - 3]) % MOD;
  }
  long long x = dp[n], y = dp[m];
  if (n >= 2) x += dp[n - 2];
  if (m >= 2) y += dp[m - 2];
  cout << ((x - 1 + y - 1) * 2 + 2) % MOD;
  return 0;
}
