Problem: A + B balls are arranged in a row. The leftmost A balls are colored red, and the rightmost B balls are colored blue.

You perform the following operation:

* First, you choose two integers s, t such that 1 \leq s, t \leq A + B.
* Then, you repeat the following step A + B times: In each step, you remove the first ball or the s-th ball (if it exists) or the t-th ball (if it exists, all indices are 1-based) from left in the row, and give it to Snuke.



In how many ways can you give the balls to Snuke? Compute the answer modulo 10^9 + 7.

Here, we consider two ways to be different if for some k, the k-th ball given to Snuke has different colors. In particular, the choice of s, t doesn't matter. Also, we don't distinguish two balls of the same color.

Constraints

* 1 \leq A, B \leq 2000

Input

Input is given from Standard Input in the following format:


A B


Output

Print the answer.

Examples

Input

3 3


Output

20


Input

4 4


Output

67


Input

7 9


Output

7772


Input

1987 1789


Output

456315553

Solution (in CPP):

Solution:
#include <bits/stdc++.h>

using namespace std;
using namespace std::chrono;

#define rep(i,a,b) for(int i = a;i<(b);++i)
#define trav(a,v) for(auto& a : v)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;

const ll big = 1000000007ll;
const ll big2 = 1000000009ll;
ll n,m,k,q,w,h,T;

ll DP[2001][2001][3] = {0};
bool DPC[2001][2001][3] = {0};

ll FAC[5000] = {0};
ll INV[5000] = {0};

ll CSA[2001][2001] = {0};
ll CSB[2001][2001] = {0};

ll mod(ll i){
    if(i<0)return mod(big-mod(-i));
    if(i<big)return i;
    return i%big;
}

ll upp(ll i, ll j){
    if(j == 0)return 1;
    if(j%2 == 0){
        ll h = upp(i,j/2);
        return mod(h*h);
    }
    return mod(i*upp(i,j-1));
}

ll bin(ll i, ll j){
    if(i < 0 || j < 0 || i < j)return 0;
    return mod(FAC[i]*mod(INV[j]*INV[i-j]));
}

void setup(){
    ll t = 1;
    for(ll c1 =0 ; c1 < 5000; c1++){
        FAC[c1] = t;
        INV[c1] = upp(t,big-2);
        t *= c1+1;
        t = mod(t);
    }

    for(ll c1 = 0; c1 < 2001; c1++){
        CSA[c1][0] = 1;
        for(ll c2 = 1; c2 < 2001; c2++){
            CSA[c1][c2] = mod(CSA[c1][c2-1] + bin(c1,c2));
        }
    }

    for(ll c1 = 0; c1 < 2001; c1++){
        CSB[c1][0] = 1;
        for(ll c2 = 1; c2 < 2001; c2++){
            CSB[c1][c2] = mod(CSB[c1][c2-1] + CSA[c1][c2]);
        }
    }

}

ll dp(ll a, ll b, ll era){
    if(a < 0 || b < 0)return 0;
    if(a*b*era == 0)return 1;
    if(era == 1)return CSB[b-1][a];
    if(DPC[a][b][era])return DP[a][b][era];
    ll ans = dp(a-1,b,era);
    for(ll c1 = 0; c1 < b; c1++){
        ans += bin(b-1,c1)*dp(a-c1,c1,1);
        ans = mod(ans);
    }
    DPC[a][b][era] = 1;
    DP[a][b][era] = ans;
    return ans;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);
    ll a,b,c,d;

    setup();
    cin >> n >> m;
    cout << dp(n,m,2) << "\n";

    return 0;
}