#include <bits/stdc++.h>
using namespace std;
long long fct[100001], n, m, v1 = 0, v2 = 0, MOD = 1e9 + 7, ans = 0;
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long b, long long m) {
  long long x, y;
  long long g = gcdExtended(b, m, &x, &y);
  if (g != 1) return -1;
  return (x % m + m) % m;
}
long long chode(long long a, long long b) {
  long long res = fct[a], t1 = modInverse(fct[b], MOD),
            t2 = modInverse(fct[a - b], MOD);
  res *= t1;
  res += MOD;
  res %= MOD;
  res *= t2;
  res += MOD;
  res %= MOD;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  fct[0] = 1;
  for (long long i = 1; i <= max(n, m); i++) {
    fct[i] = fct[i - 1];
    fct[i] *= (long long)i;
    fct[i] += MOD;
    fct[i] %= MOD;
  }
  for (int i = 1; (n - 2 * i) >= 0; i++) {
    v1 += chode(n - i, i);
    v1 += MOD;
    v1 %= MOD;
  }
  for (int i = 1; (m - 2 * i) >= 0; i++) {
    v2 += chode(m - i, i);
    v2 += MOD;
    v2 %= MOD;
  }
  ans = (long long)1 + v1 + v2;
  ans *= (long long)2;
  ans += MOD;
  ans %= MOD;
  cout << ans << endl;
  cout.flush();
  return 0;
}
