#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dp[1001][1001];
int sdp[1001][1001];
int ssdp[1001][1001];
int ssdp2[1001];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= n; ++j) {
      dp[i][j] = 1;
    }
  }
  for (int u = 1; u <= m; ++u) {
    for (int l = 1; l <= n; ++l) {
      for (int r = 1; r <= n; ++r) {
        sdp[l][r] = (sdp[l][r - 1] + dp[l][r]) % MOD;
      }
    }
    for (int r = 1; r <= n; ++r) {
      for (int l = 1; l <= n; ++l) {
        ssdp[r][l] = (ssdp[r][l - 1] + sdp[l][r]) % MOD;
      }
      ssdp2[r] = (sdp[r][r - 1] + ssdp2[r - 1]) % MOD;
    }
    for (int r = 1; r <= n; ++r) {
      for (int l = 1; l <= r; ++l) {
        dp[l][r] = (ssdp[n][l] - ssdp[r - 1][l]) % MOD;
      }
      for (int l = r + 1; l <= n; ++l) {
        dp[l][r] =
            ((long long)ssdp[n][l] - ssdp[r - 1][r] - ssdp2[l] + ssdp2[r]) %
            MOD;
      }
    }
  }
  cout << (dp[n][1] + MOD) % MOD;
}
