#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 5;
const long long mod = 1e9 + 7;
int n, m;
long long dp[15][MAX_N], sum[15][MAX_N], sum2[MAX_N];
int main() {
  memset(sum, 0, sizeof(sum)), memset(dp, 0, sizeof(dp));
  scanf("%d", &n), scanf("%d", &m);
  for (register int i = 1; i <= n; i++)
    dp[1][i] = 1ll, sum[1][i] = dp[1][i] + sum[1][i - 1];
  for (register int i = 2; i <= m; i++)
    for (register int j = 1; j <= n; j++) {
      dp[i][j] = sum[i - 1][j];
      sum[i][j] = (sum[i][j - 1] + dp[i][j]) % mod;
    }
  for (register int i = 1; i <= n; i++)
    sum2[i] = (sum2[i - 1] + dp[m][i]) % mod;
  long long ans = 0;
  for (register int i = 1; i <= n; i++)
    ans = (ans + (dp[m][i] * sum2[n - i + 1]) % mod) % mod;
  printf("%lld\n", (ans + mod) % mod);
  return 0;
}
