#include <bits/stdc++.h>
using namespace std;
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(
                chrono::high_resolution_clock::now().time_since_epoch())
                .count());
const long long int N = 20005;
const long long int LG = 22;
long long int n, m;
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int fact[N], ifact[N];
void proecss() {
  fact[0] = 1;
  for (long long int i = 1; i < N; i++)
    fact[i] = (fact[i - 1] * i) % 1000000007;
  for (long long int i = 0; i < N; i++)
    ifact[i] = power(fact[i], 1000000007 - 2, 1000000007);
}
long long int nCr(long long int n, long long int r) {
  if (r > n) return 0;
  if (r == n) return 1;
  long long int ans = (ifact[n - r] * ifact[r]) % 1000000007;
  ans = (ans * fact[n]) % 1000000007;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  proecss();
  cin >> n >> m;
  long long int b[n + 5], a[n + 5];
  for (long long int i = 1; i <= n; i++) {
    long long int nn = n - i + 1;
    long long int rr = m - 1;
    b[i] = nCr(nn + rr - 1, rr);
    a[i] = nCr(i + rr - 1, rr);
  }
  for (long long int i = n - 1; i >= 1; i--)
    b[i] += b[i + 1], b[i] %= 1000000007;
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    ans = (ans + (a[i] * b[i]) % 1000000007) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
