#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e5 + 20;
const long long mod = 1e9 + 7;
const bool debug = false;
template <class T>
inline void add(T &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
template <class T>
inline void del(T &x, long long y) {
  x -= y;
  if (x < 0) x += mod;
}
template <class T>
inline void add(T &x, long long y, long long z) {
  x = y + z;
  if (x >= mod) x -= mod;
}
inline long long qpow(long long x, long long y) {
  x %= mod;
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ret;
}
inline long long qmul(long long x, long long y, long long mod) {
  return ((x * y - (long long)((long double)x * y / mod) * mod) + mod) % mod;
}
inline long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
inline long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int F[N], Finv[N], inv[N];
void init() {
  inv[1] = 1, F[0] = Finv[0] = 1;
  for (int i = 2; i < N; ++i)
    inv[i] = (mod - mod / i) * 1ll * inv[mod % i] % mod;
  for (int i = 1; i < N; ++i) {
    F[i] = F[i - 1] * 1ll * i % mod;
    Finv[i] = Finv[i - 1] * 1ll * inv[i] % mod;
  }
}
int comb(int n, int m) {
  if (m < 0 || m > n) return 0;
  return F[n] * 1ll * Finv[n - m] % mod * Finv[m] % mod;
}
int main() {
  init();
  int n, m;
  long long ans = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= max(n, m); ++i) {
    ans += comb(n - i, i) + comb(m - i, i);
  }
  ans = (ans + 1) * 2 % mod;
  printf("%lld\n", ans);
  return 0;
}
