#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  T fg = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') fg = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x = fg * x;
}
template <typename T, typename... Args>
inline void read(T &x, Args &...args) {
  read(x), read(args...);
}
template <typename T>
inline void write(T x) {
  int len = 0;
  char c[21];
  if (x < 0) putchar('-'), x = -x;
  do {
    ++len;
    c[len] = x % 10 + '0';
  } while (x /= 10);
  for (int i = len; i >= 1; i--) putchar(c[i]);
}
template <typename T, typename... Args>
inline void write(T x, Args... args) {
  write(x), write(args...);
}
inline long long mul(long long a) { return a; }
template <typename... Args>
inline long long mul(long long a, Args... args) {
  return a * mul(args...) % 1000000007;
}
inline long long add(long long a) { return a; }
template <typename... Args>
inline long long add(long long a, Args... args) {
  long long res = (a + add(args...)) % 1000000007;
  if (res < 0) res += 1000000007;
  return res;
}
inline long long fpow(long long a, long long p) {
  long long res = 1;
  for (; p; p >>= 1) {
    if (p & 1) res = mul(res, a);
    a = mul(a, a);
  }
  return res;
}
inline long long getInv(long long x) { return fpow(x, 1000000007 - 2); }
inline long long fmul(long long a, long long b) {
  long long res = 0;
  for (; b; b >>= 1) {
    if (b & 1) res = add(res, a);
    a = add(a, a);
  }
  return res;
}
long long fac[100005], inv[100005];
long long C(long long n, long long m) {
  if (m < 0 || m > n) return 0;
  return mul(fac[n], mul(inv[n - m], inv[m]));
}
long long P(long long n, long long m) { return mul(fac[n], fac[n - m]); }
void init() {
  fac[0] = 1;
  for (int i = 1; i < 100002; i++) {
    fac[i] = mul(fac[i - 1], i);
  }
  inv[100002 - 1] = fpow(fac[100002 - 1], 1000000007 - 2);
  for (int i = 100002 - 2; i >= 0; i--) inv[i] = mul(inv[i + 1], i + 1);
}
long long f[100005];
int main() {
  init();
  int n, m;
  read(n, m);
  long long ans = 0;
  for (int i = n % 2; i <= n; i += 2) {
    long long cnt12 = (n - i) / 2;
    ans = add(ans, C(cnt12 + i, i));
  }
  for (int i = m % 2; i <= m; i += 2) {
    long long cnt12 = (m - i) / 2;
    ans = add(ans, C(cnt12 + i, i));
  }
  ans = add(ans, -1);
  cout << mul(ans, 2) << '\n';
  return 0;
}
