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;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<double, double> pd;
typedef pair<int, int> pi; typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;  typedef pair<ll, pi> plp;
typedef pair<int, pi> pip; typedef tuple<int, int, int> ti;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const int MAX_N = 2e3 + 100, MOD = 1e9 + 7;

int A, B, C[MAX_N][MAX_N], Sum[MAX_N][MAX_N];
void add(int &a, int b) {
	if((a+=b) >= MOD) a -= MOD;
	if(a < 0) a += MOD;
}
int Pow2[MAX_N];
int main() {
	cin >> A >> B;
	for(int i=0, j; i<MAX_N; i++) for(C[i][0]=1, j=1; j<=i; j++) C[i][j] = (C[i-1][j-1] + C[i-1][j]) % MOD;
	Pow2[0] = 1;
	for(int i=1; i<MAX_N; i++) Pow2[i] = Pow2[i-1] * 2 % MOD;
	for(int x=0; x<MAX_N; x++) {
		Sum[x][0] = 1;
		int sum = 1;
		for(int y=1; y<=x; y++) {
			add(sum, C[x][y]);
			Sum[x][y] = Sum[x][y-1];
			add(Sum[x][y], sum);
		}
	}

	int ans = 0;
	for(int pq=0; pq<=A; pq++) {
		for(int p=0, q=pq; p<=pq; p++, q--) {
			int fv = C[B-1][q];
			int sv = 1;
			if(q > 0) {
				sv = Sum[q-1][min(q-1, p)];
				add(sv, 1ll * max(0, p - (q-1)) * Pow2[q-1] % MOD);
			}
			add(ans, 1ll * fv * sv % MOD);
		}
	}
	printf("%d\n", ans);
	return 0;
}
