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 <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=(j); i<=(k); i++)
#define FFOR(i, j, k) for(int i=(j); i<(k); i++)
#define DFOR(i, j, k) for(int i=(j); i>=(k); i--)
#define bug(x) cerr<<#x<<" = "<<(x)<<'\n'
#define pb push_back
#define mp make_pair
#define bit(s, i) (((s)>>(i))&1LL)
#define mask(i) ((1LL<<(i)))
#define builtin_popcount __builtin_popcountll
#define __builtin_popcount __builtin_popcountll
using ll=long long; using ld=long double;
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); const ld pi=acos(0)*2;
template <typename T> inline void read(T &x){char c; bool nega=0; while((!isdigit(c=getchar()))&&(c!='-')); if(c=='-'){nega=1; c=getchar();} x=c-48; while(isdigit(c=getchar())) x=x*10+c-48; if(nega) x=-x;}
template <typename T> inline void writep(T x){if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){ putchar('-'); x=-x;} writep(x);}
template <typename T> inline void writeln(T x){write(x); putchar('\n');}
template <typename CT, typename T> inline void reset_container(CT &c, int sz, T v){c.resize(sz); for(auto &x: c) x=v;}
#define taskname "code_festival_2017_qualb_e"
int a, b;
const int base=1000000007;
int c[2001][2001];
int sum[2001][2001];
int f[2001][2001];
int main(){
    #ifdef Aria
        if(fopen(taskname".in", "r"))
            freopen(taskname".in", "r", stdin);
    #endif // Aria
    read(a);
    read(b);
    FOR(i, 0, 2000){
        c[i][i]=c[i][0]=1;
        FFOR(j, 1, i){
            c[i][j]=c[i-1][j]+c[i-1][j-1];
            while(c[i][j]>=base) c[i][j]-=base;
        }
        sum[i][0]=1;
        if(i) FOR(j, 1, i){
            sum[i][j]=c[i][j]+sum[i][j-1];
            while(sum[i][j]>=base) sum[i][j]-=base;
        }
    }
//    FOR(i, 0, 5) FOR(j, 0, 5) cerr<<c[i][j]<<" \n"[j==5];
    FOR(x, 0, a){
        FOR(y, 0, b){
            if(y==0) f[x][y]=1;
            else{
                f[x][y]=(x?f[x-1][y]:0)+sum[y-1][min(x, y-1)];
                while(f[x][y]>=base) f[x][y]-=base;
            }
        }
    }

    ll ans=0;
    FOR(x, 0, a){///
        ///delete b character, the first is B
        FOR(y, 0, min(x, b-1)){/// y of them is R
            ans=(1LL*f[x-y][y]*c[b-1][y]+ans)%base;
        }
        /**
        f[0][3]*c[3][0]
        f[1][2]*c[3][1]
        f[2][1]*c[3][2]
        f[3][0]*c[3][3]
        */
    }
    writeln(ans);
}