#include <bits/stdc++.h>
using namespace std;
int n, m;
int dp[1010][15];
int add(int a, int b) {
  int ret = a + b;
  if (ret >= 1000000007) ret -= 1000000007;
  return ret;
}
int sub(int a, int b) {
  int ret = a - b;
  if (ret < 0) ret += 1000000007;
  return ret;
}
int mul(long long a, long long b) { return (a * b) % 1000000007; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) dp[i][1] = 1;
  for (int j = 1; j <= m; j++) dp[1][j] = 1;
  for (int i = 2; i <= n; i++)
    for (int j = 2; j <= m; j++) dp[i][j] = add(dp[i - 1][j], dp[i][j - 1]);
  int sum = 0;
  for (int i = 1; i <= n; i++) sum = add(sum, dp[i][m]);
  int sol = 0;
  for (int i = 1; i <= n; i++)
    sol = add(sol, mul(dp[i][m], sum)), sum = sub(sum, dp[n - i + 1][m]);
  cout << sol;
  return 0;
}
