#include <bits/stdc++.h>
using namespace std;
long long int fact[100005];
long long int fact_(long long int n) {
  long long int ans = 1;
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= n; i++) {
    ans = (ans * i) % 1000000007;
    fact[i] = ans % 1000000007;
  }
  return ans;
}
long long int mod_inv(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b % 2 == 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b >> 1;
  }
  return ans;
}
long long int ncr(long long int n, long long int r) {
  if (n < r) return 0;
  if (r == 0) return n;
  if (r == 1) return n;
  if (n == r) return 1;
  return ((((fact[n] % 1000000007) *
            mod_inv(fact[r] % 1000000007, 1000000007 - 2)) %
           1000000007) *
          mod_inv(fact[n - r] % 1000000007, 1000000007 - 2)) %
         1000000007;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  fact_(max(n, m) + 2);
  long long int ans = 0;
  for (int i = 1; i <= n / 2 + 1; i++) {
    ans += ncr(n - i, i);
    ans = ans % 1000000007;
  }
  for (int i = 1; i <= m / 2 + 1; i++) {
    ans += ncr(m - i, i);
    ans = ans % 1000000007;
  }
  cout << ((2 * ans) % 1000000007 + 2) % 1000000007 << endl;
}
