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
//2017-10-9
//miaomiao
//
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>

using namespace std;

#define For(i, a, b) for(int i = (a); i <= (int)(b); ++i)
#define N (2000+5)

const int P = 1e9 + 7;

int Mod(int x){
	if(x < 0) x += P;
	return x >= P? x-P: x;
}

int C[N][N], csum[N][N];
int f[N][N], fsum[N][N], g[N][N];

void Init(int n){
	C[0][0] = 1;
	For(i, 1, n){
		C[i][0] = csum[i][0] = 1;
		For(j, 1, i){
			C[i][j] = Mod(C[i-1][j] + C[i-1][j-1]);
			csum[i][j] = Mod(csum[i][j-1] + C[i][j]);
		}
	}

	int l, r;

	For(i, 0, n) f[0][i] = f[i][0] = 1;
	
	fsum[0][0] = f[0][0];
	For(i, 1, n) fsum[i][0] = Mod(fsum[i-1][0] + f[i][0]);

	For(i, 1, n) For(j, 1, n){
		l = max(0, j-i); r = j;
		f[i][j] = csum[j][r];
		if(l) f[i][j] = Mod(f[i][j] - csum[j][l-1]);
	}
	For(j, 1, n){
		fsum[0][j] = f[0][j];
		For(i, 1, n) fsum[i][j] = Mod(fsum[i-1][j]+f[i][j]);
	}

//	puts("----------------------");
//	For(i, 0, 3) For(j, 0, 3) printf("f[%d][%d] = %d\n", i, j, f[i][j]);

	For(i, 0, n) g[0][i] = g[i][0] = 1;
	For(x, 1, n) For(y, 1, n) g[x][y] = fsum[x][y-1];
	
//	puts("----------------------");
//	For(i, 0, 3) For(j, 0, 3) printf("g[%d][%d] = %d\n", i, j, g[i][j]);
}

int main(){
//!
//	freopen("test.in", "r", stdin);
//	freopen("test.out", "w", stdout);
	
	int A, B, x, y, u, v;
	int ans = 0;

	Init(2000);
	scanf("%d%d", &A, &B);
	
//	puts("*********************");
	For(k, 0, A){
		x = A - k; y = B - 1;
		
		For(t, 0, y){
			u = x - (y-t); v = y - t;
			if(u < 0) continue;

//			printf("k = %d u = %d v = %d add = %d\n", k, u, v, g[u][v]);
			ans = Mod(ans + 1ll * g[u][v] * C[y][t] % P);
		}
	}

	printf("%d\n", ans);

	return 0;
}