#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PLL = pair<LL, LL>;
using VL = vector<LL>;
using VLL = vector<PLL>;
using VVL = vector<vector<LL> >;
const LL INF = 1e18 + 7;
const LL MOD = 1e9 + 7;
const LL N = 2e5 + 7;
LL n, m;
LL suf[N] = {0, 0, 1, 1, 1, 2};
LL sum[N] = {0, 0, 1, 3, 6, 11};
LL ans;
inline LL solve() {
  cin >> n >> m;
  LL len = max(n, m);
  for (int i = 3; i <= len; ++i) {
    suf[i] = (sum[i - 3] + 1) % MOD;
    sum[i] = (sum[i - 1] + suf[i]) % MOD;
  }
  ans = 2 + (sum[n] + sum[m]) * 2;
  ans = (ans % MOD + MOD) % MOD;
  cout << ans << endl;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long testcases = 1, CaseNumber = 0;
  for (CaseNumber = 1; CaseNumber <= testcases; ++CaseNumber) {
    solve();
  }
  return 0;
}
