#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, maxn = 2005;
int n, m, dp[maxn][maxn];
void add(int &x, int y) {
  x = x + y >= 1000000007 ? x + y - 1000000007 : x + y;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) dp[1][i] = 1;
  for (int i = 2; i <= n; i++) {
    int sum = 0;
    dp[i][1] = 1;
    for (int j = 2; j <= m; j++) {
      add(sum, dp[i - 1][j]);
      add(dp[i][j], dp[i][j - 1] + sum);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 2; j <= m; j++)
      add(ans, (long long)(dp[i][j] - dp[i - 1][j] + 1000000007) *
                   dp[n - i + 1][j] % 1000000007 * (m - j + 1) % 1000000007);
  printf("%d\n", ans);
  return 0;
}
