#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
const long long mod = 1e9 + 7;
int n, m, t, a[maxn], b[maxn], c[maxn], ta, tb, tc;
long long dp[maxn][15];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i <= n; i++) {
    dp[i][0] = 1;
  }
  for (int i = 0; i <= m; i++) {
    dp[0][i] = 1;
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
    }
  }
  for (int i = n; i >= 1; i--) {
    dp[i][m] -= dp[i - 1][m];
    if (dp[i][m] < 0) dp[i][m] += mod;
  }
  long long ans = 0;
  long long tmp = 0;
  for (int i = 1; i <= n; i++) {
    tmp += dp[i - 1][m];
    tmp %= mod;
    ans += tmp * dp[n - i][m];
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
