#include <bits/stdc++.h>
using namespace std;
int n, m;
long long gt[10000009], igt[10000009], res(0);
void ADD(long long &x, long long y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
long long _pow(long long a, long long n) {
  if (n == 0) return 1;
  long long x = _pow(a, n / 2);
  x = (x * x) % 1000000007;
  if (n % 2) x = (x * a) % 1000000007;
  return x;
}
long long Ckn(int k, int n) {
  return 1ll * gt[n] * igt[k] % 1000000007 * igt[n - k] % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> m;
  gt[0] = gt[1] = 1;
  for (int i = 1; i <= max(n, m); i++)
    gt[i] = (1ll * gt[i - 1] * i) % 1000000007;
  igt[max(m, n)] = _pow(gt[max(n, m)], 1000000007 - 2);
  for (int i = max(m, n) - 1; i >= 0; i--)
    igt[i] = (1ll * igt[i + 1] * (i + 1)) % 1000000007;
  cout << 1ll * 2 * (Ckn(2, n) + Ckn(2, m)) % 1000000007;
  return 0;
}
