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
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))

typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;

#define AIN(A, B, C) assert(IN(A, B, C))

//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;

const LL MOD = 1000000007;
LL dp1[2010][2010];
LL sdp1[2010][2010];
LL dp2[2010][2010];

int main()
{
	for (int i = 0; i <= 2004; i++) {
		for (int j = 0; j <= 2004; j++) {
			if (i == 0 || j == 0) {
				sdp1[i][j] = 1;
			}
			else {
				sdp1[i][j] = (sdp1[i][j - 1] + sdp1[i - 1][j - 1]) % MOD;
			}
		}
	}

	for (int i = 0; i <= 2004; i++) {
		for (int j = 0; j <= 2004; j++) {
			sdp1[i][j] = (sdp1[i][j] + sdp1[i - 1][j]) % MOD;
		}
	}

	for (int i = 0; i <= 2004; i++) {
		for (int j = 0; j <= 2004; j++) {
			if (j) {
				dp1[i][j] = sdp1[i][j - 1];
			}
			else {
				dp1[i][j] = 1;
			}
		}
	}

	for (int i = 0; i <= 2004; i++) {
		for (int j = 0; j <= 2004; j++) {
			if (i == 0 && j == 0) {
				dp2[i][j] = 1;
			}
			else if (j == 0) {
				dp2[i][j] = 0;
			}
			else if (i == 0) {
				dp2[i][j] = 1;
			}
			else {
				dp2[i][j] = (dp2[i - 1][j - 1] + dp2[i][j - 1]) % MOD;
			}
		}
	}

	int AA, BB;
	scanf("%d %d", &AA, &BB);

	LL ans = 0;
	{
		for (int a = 0; a <= AA; a++) {
			// first, a ta r.
			// then, 1 ta b.
			int A = AA - a;
			int B = BB - 1;

			int j = B;
			for (int i = 0; i <= MIN(A, B); i++) {
				LL way1 = dp2[i][j];
				LL way2 = dp1[A - i][i];
				ans = (ans + way1 * way2) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}
