#include <bits/stdc++.h>
using namespace std;
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(long long &x, long long y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(long long &x, long long y) { return (y > x) ? x = y, 1 : 0; }
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int mod = (int)1e9 + 7;
const int mod1 = (int)1e9 + 9;
const int mod2 = 998244353;
const long double eps = 1e-12;
const double pi = atan2(0, -1);
const int ABC = 26;
long long fac[100007];
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long modInverse(long long n) { return power(n, mod - 2); }
long long nCrModPFermat(long long n, long long r) {
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r]) % mod * modInverse(fac[n - r]) % mod) %
         mod;
}
int main() {
  fac[0] = 1;
  for (int i = 1; i <= 100007; i++) {
    fac[i] = (fac[i - 1] * i) % mod;
  }
  int n, m;
  cin >> n >> m;
  int i;
  int mul = 1;
  int ans = 0;
  for (i = 0; 2 * i <= n; i++) {
    ans = (ans + nCrModPFermat(n - i, i)) % mod;
  }
  for (i = 0; 2 * i <= m; i++) {
    ans = (ans + nCrModPFermat(m - i, i)) % mod;
  }
  cout << 2 * ans - 2;
  return 0;
}
