#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > dp(m, vector<long long>(n + 1));
  vector<vector<long long> > dp1(m, vector<long long>(n + 1));
  vector<vector<long long> > dp2(m, vector<long long>(n + 1));
  for (long long i = m - 1; i >= 0; i--) {
    long long la = 0;
    for (long long j = n; j > 0; j--) {
      if (i == m - 1) {
        la++;
        dp[i][j] = la;
      } else {
        dp[i][j] = dp[i + 1][j];
        if (j < n) dp[i][j] += dp[i][j + 1];
        if (dp[i][j] >= M) dp[i][j] -= M;
      }
    }
  }
  for (long long i = m - 1; i >= 0; i--) {
    long long la = 0;
    for (long long j = 1; j <= n; j++) {
      if (i == m - 1) {
        la++;
        dp1[i][j] = la;
        dp2[i][j] = 1;
      } else {
        dp2[i][j] = dp1[i][j] = dp1[i + 1][j];
        if (j > 1) dp1[i][j] += dp1[i][j - 1];
        if (dp1[i][j] >= M) dp1[i][j] -= M;
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += (dp2[0][i] * dp[0][i]) % M;
    if (ans >= M) ans -= M;
  }
  cout << ans;
  return 0;
}
