#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> ways(11, vector<long long>(1011, 0));
  for (long long i = 1; i <= 10; i++) ways[i][1] = 1;
  for (long long i = 1; i <= 1010; i++) ways[0][i] = 1, ways[1][i] = i;
  for (long long i = 2; i <= 10; i++) {
    for (long long j = 2; j <= 1010; j++) {
      ways[i][j] = (ways[i - 1][j] + ways[i][j - 1]) % mod;
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    (ans += (ways[m][i] * ways[m - 1][n - i + 1]) % mod) %= mod;
  cout << ans << endl;
}
