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
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef pair<double,int>Q;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
ll modpow(ll x,ll n)
{
	ll res=1;
	while(n>0)
	{
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[100005],R[100005];
void make(){
	F[0] = 1;
	for(int i=1;i<100005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<100005;i++) R[i] = modpow(F[i],mod-2);
}
ll C(int a,int b){
	return F[a]*R[b]%mod*R[a-b]%mod;
}
ll cc[2005][2005],rui[2005][2005],rui2[2005][2005];
int main(){
	make();
	int a,b;cin>>a>>b;
	cc[0][0]=1;
	for(int i=1;i<2005;i++) for(int j=0;j<=i;j++){
		if(j==0||j==i) cc[i][j]=1;
		else{
			cc[i][j] = cc[i-1][j-1]+cc[i-1][j];
			cc[i][j] %= mod;
		}
	}
	//cout<<cc[5][2]<<endl;
	for(int i=0;i<2005;i++){
		for(int j=0;j<=i;j++){
			if(j==0) rui[i][j] = cc[i][j];
			else rui[i][j] = (rui[i][j-1]+cc[i][j])%mod;
		}
	}
	for(int i=0;i<2005;i++){
		for(int j=0;j<=i;j++){
			if(j==0) rui2[i][j] = rui[i][j];
			else rui2[i][j] = (rui2[i][j-1]+rui[i][j])%mod;
		}
	}
	ll ans = 0;
	for(int x=0;x<=a;x++){
		for(int k=x;k<=a;k++){
		    if(b-1<k-x) continue;
			ll ret = C(b-1,k-x); //assert(b-1<k-x);
			if(x==k){
				ans=(ans+ret)%mod;
			}
			else{
				ll sum=0;
				if(a-k >= k-x-1){
					sum = (a-k) - (k-x-1);
					sum = sum*modpow(2,k-x-1)%mod;
					sum = (sum+rui2[k-x-1][k-x-1])%mod;
				}
				else{
					sum = rui2[k-x-1][a-k];
				}
				sum%=mod;
				ans += ret*sum%mod;
				ans %= mod;
			}
			
		}
	}
	cout<<ans%mod<<endl;
}