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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

const ll M = 1000000007;

ll C[2002][2002];
ll inv[2002];
ll modpow(ll x,ll k){
	if(k == 0)return 1;
	ll ret = modpow(x,k/2);
	ret *= ret; ret %= M;
	if(k%2 == 1){
		ret *= x;
		ret %= M;
	}
	return ret;
}

int main(){
	rep(i,2002)inv[i] = modpow(i,M-2);
	for(int i = 0 ; i < 2002 ; i ++){
		C[i][0] = 1;
		for(int j = 0 ; j < i ; j ++){
			C[i][j+1] = C[i][j]*(i-j); C[i][j+1] %= M;
			C[i][j+1] *= inv[j+1];
			C[i][j+1] %= M;
		}
	}
	
	int a,b;
	cin >> a >> b;
	
	ll ret = a+1;
	for(int i = 1 ; i <= b-1 ; i ++){
		for(int j = 1 ; j <= b-i ; j ++){
			if(a-(b-i)-(b-i-j) >= 0){
				ll _ret = C[b-1][i-1]*C[b-i-1][j-1]; _ret %= M;
				_ret *= C[a-(b-i)-(b-i-j)+2][2];
				//cout << a-(b-i)-(b-i-j)+2 << " " << 2 << endl;
				_ret %= M;
				ret += _ret;
				ret %= M;
				//cout << i << " " << j << " " << _ret << endl;
			}
		}
	}
	cout << ret << endl;
}