#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e5 + 47, mod = 1e9 + 7;
long long dp[MAXN][3][2];
long long n, m;
void read() {
  cin >> n >> m;
  dp[1][1][0] = dp[1][1][1] = 1;
  dp[2][1][0] = dp[2][1][1] = 1;
  dp[2][2][0] = dp[2][2][1] = 1;
  for (long long i = 3; i < MAXN; i++) {
    for (long long len = 1; len < 3; len++) {
      for (long long frt = 0; frt < 2; frt++) {
        dp[i][len][frt] += dp[i - len][1][frt ^ 1] + dp[i - len][2][frt ^ 1];
        dp[i][len][frt] %= mod;
      }
    }
  }
  long long ans = 0;
  for (long long len = 1; len < 3; len++)
    for (long long frt = 0; frt < 2; frt++)
      ans += dp[n][len][frt] + dp[m][len][frt];
  ans = (ans - 2 + mod);
  ans %= mod;
  cout << ans << "\n";
}
void solve() {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    read();
    solve();
  }
}
