#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
const int N = 1e5 + 20, mod = 1e9 + 7;
int n, m, fac[N], inv[N], ans;
inline int pw(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return res;
}
inline int C(int n, int k) {
  if (k < 0 || k > n) return 0;
  return 1ll * fac[n] * inv[k] % mod * inv[n - k] % mod;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[N - 1] = pw(fac[N - 1], mod - 2);
  for (int i = N - 2; i >= 0; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
  cin >> n >> m;
  for (int k = 0; k <= n; k++) {
    ans = (ans + 2 * C(k, n - k) % mod) % mod;
  }
  for (int k = 0; k <= m; k++) {
    ans = (ans + 2 * C(k, m - k) % mod) % mod;
  }
  ans = (ans + mod - 2) % mod;
  cout << ans << '\n';
}
