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

//Michał Glapa
#include<cstdio>
#include<set>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdlib>
#include<time.h>
#include<stack>
#include<cmath>
#include<iostream>
#include<cstring>
#include<tr1/unordered_set>
#include<tr1/unordered_map>
using namespace std;
#define FOR(i,j,k) for(int i=j;i<k;i++)
#define FORD(i,j,k) for(int i=j;i>=k;i--)
#define ll long long
#define pii  pair<int, int>
#define vi vector<int >
#define pb push_back
#define mp make_pair
#define make(n) int n; scanf("%d",&n)
#define st first
#define nd second
#define INF 2000000001
#define VAR(i,n) __typeof(n) i = (n)
#define FOREACH(i,c) for(VAR(i,(c).begin());i!=(c).end();i++)
#define FORDEACH(i,c) for( VAR(i,(c).rbegin(),i!=(c).rend();i++)
#define REP(i,n) FOR(i,0,n)
#define ld long double
const long long INFLL = (ll)INF * (ll)INF;
const ld EPS = 10e-9;

#define MAXN 2007
#define int long long

int dp[MAXN][MAXN];
int dp2[MAXN][MAXN];
int MOD = (10e9)+7;
main()

{
    int n,m;
    scanf("%I64d %I64d",&n,&m);
    //DP
    for(int i=0;i<=m-2;i++)
        dp[i][0]=1;
    for(int h=1;h<n;h++)
    {
        int sum=0;
        int val=0;
        for(int l=0;l<=m-2;l++)
        {
            sum+=dp[l][h-1];
            val+=sum;
            sum%=MOD;
            val%=MOD;
            dp[l][h]=val;

        }
    }
    //DP2
    for(int l=0;l<=m-2;l++)
        dp2[l][0]=dp[l][0];
    for(int h=1;h<n;h++)
    {
        for(int l=0;l<=m-2;l++)
            dp2[l][h] =( dp2[l][h-1]+dp[l][h])%MOD;
    }
    //res
    int res=0;
    for(int i=0;i<n;i++)
    {
        for(int l=0;l<=m-2;l++)
        {
            int tmp=(dp2[l][i]*(dp2[l][n-1-i] - (n-1-i >0 ? dp2[l][n-2-i] : 0)));
            tmp%=MOD;
            tmp*=m-l-1;
            tmp%=MOD;
            //printf("%d\n",tmp);
            res+=tmp;
            res%=MOD;
        }
    }
    printf("%I64d\n",res);


}

