#include <bits/stdc++.h>
int main() {
  constexpr long long int MOD = 1000000007;
  std::cin.tie(0);
  std::cin.sync_with_stdio(false);
  int n, m;
  std::cin >> n >> m;
  std::vector<long long int> factorial(std::max(n, m) + 1, 1),
      inv(std::max(n, m) + 1, 1), inv_fact(std::max(n, m) + 1, 1);
  for (auto i = 2; i < factorial.size(); ++i) {
    factorial[i] = i * factorial[i - 1] % MOD;
    inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
    inv_fact[i] = inv[i] * inv_fact[i - 1] % MOD;
  }
  long long int result = 2;
  for (auto height = (n + 1) / 2; height < n; ++height) {
    result += factorial[height] * inv_fact[n - height] % MOD *
              inv_fact[2 * height - n] % MOD * 2 % MOD;
    result %= MOD;
  }
  for (auto width = (m + 1) / 2; width < m; ++width) {
    result += factorial[width] * inv_fact[m - width] % MOD *
              inv_fact[2 * width - m] % MOD * 2 % MOD;
    result %= MOD;
  }
  std::cout << result << '\n';
}
