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 MAX_N = 2e3 + 10;
const long long mod = 1e9 + 7;
const long long INF = 1e9;
inline long long bpow(long long t, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * t) % mod;
    t = (t * t) % mod, n >>= 1;
  }
  return ans;
}
int dp[MAX_N][MAX_N];
int psum[MAX_N][MAX_N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(0);
  int n, m;
  cin >> n >> m;
  for (int i = 2; i <= m; i++) dp[1][i] = 1, psum[1][i] = i - 1;
  for (int i = 2; i <= n; i++) {
    dp[i][2] = dp[i - 1][2] + 1;
    for (int j = 3; j <= m; j++)
      dp[i][j] = (psum[i - 1][j] + dp[i][j - 1]) % mod;
    for (int j = 2; j <= m; j++) psum[i][j] = (psum[i][j - 1] + dp[i][j]) % mod;
  }
  int ans = 0;
  for (int t = 1; t <= n; t++)
    for (int i = 2; i <= m; i++)
      ans += (((dp[t][i] * dp[n - t + 1][i] % mod) * (m - i + 1))) % mod,
          ans %= mod;
  for (int t = 1; t <= n; t++)
    for (int i = 2; i <= m; i++)
      ans -= (((dp[t][i] * dp[n - t][i] % mod) * (m - i + 1)) % mod),
          ans += mod, ans %= mod;
  cout << ans;
}
