Greg has a pad. The pad's screen is an n × m rectangle, each cell can be either black or white. We'll consider the pad rows to be numbered with integers from 1 to n from top to bottom. Similarly, the pad's columns are numbered with integers from 1 to m from left to right.

Greg thinks that the pad's screen displays a cave if the following conditions hold:

  * There is a segment [l, r] (1 ≤ l ≤ r ≤ n), such that each of the rows l, l + 1, ..., r has exactly two black cells and all other rows have only white cells. 
  * There is a row number t (l ≤ t ≤ r), such that for all pairs of rows with numbers i and j (l ≤ i ≤ j ≤ t) the set of columns between the black cells in row i (with the columns where is these black cells) is the subset of the set of columns between the black cells in row j (with the columns where is these black cells). Similarly, for all pairs of rows with numbers i and j (t ≤ i ≤ j ≤ r) the set of columns between the black cells in row j (with the columns where is these black cells) is the subset of the set of columns between the black cells in row i (with the columns where is these black cells). 



Greg wondered, how many ways there are to paint a cave on his pad. Two ways can be considered distinct if there is a cell that has distinct colors on the two pictures.

Help Greg.

Input

The first line contains two integers n, m — the pad's screen size (1 ≤ n, m ≤ 2000).

Output

In the single line print the remainder after dividing the answer to the problem by 1000000007 (109 + 7).

Examples

Input

1 1


Output

0


Input

4 4


Output

485


Input

3 5


Output

451
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int add(int a, int b) { return a + b < mod ? a + b : a + b - mod; }
int mul(int a, int b) { return int(1LL * a * b % mod); }
const int N = 2005;
int dp[N][N];
int f(int n, int len) {
  if (len < 2 or n < 0) return 0;
  if (n == 0) return 1;
  int &ans = dp[n][len];
  if (~ans) return ans;
  ans = f(n - 1, len);
  ans = add(ans, f(n, len - 1));
  ans = add(ans, f(n, len - 1));
  ans = add(ans, mod - f(n, len - 2));
  return ans;
}
int pref[N][N];
int pref2[N][N];
int main() {
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      pref[i][j] = f(i, j);
      if (i > 0) pref[i][j] = add(pref[i][j], pref[i - 1][j]);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i == 0) {
        pref2[i][j] = f(i, j);
      } else {
        pref2[i][j] = pref2[i - 1][j];
        pref2[i][j] = add(pref2[i][j], f(i, j - 1));
        pref2[i][j] = add(pref2[i][j], f(i, j - 1));
        pref2[i][j] = add(pref2[i][j], mod - f(i, j - 2));
      }
    }
  }
  int n, m;
  scanf("%d %d", &n, &m);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int len = 2; len <= m; len++) {
      int tmp = mul(pref2[n - i][len], pref[i - 1][len]);
      tmp = mul(tmp, m - len + 1);
      ans = add(ans, tmp);
    }
  }
  printf("%d\n", ans);
}
