#include <cstdio>
const int N=4093,p=1e9+7;
int c[N][N],s[N][N];
int A,B,n;
inline int qm(int x){return x<p?x:x-p;}
int main(){
	scanf("%d%d",&A,&B);n=A+B;
	for(int i=0;i<=n;++i){
		c[i][0]=s[i][0]=1;
		for(int j=1;j<=i;++j)c[i][j]=qm(c[i-1][j-1]+c[i-1][j]);
		for(int j=1;j<=n;++j)s[i][j]=qm(s[i][j-1]+c[i][j]);
		for(int j=1;j<=n;++j)s[i][j]=qm(s[i][j-1]+s[i][j]);
	}
	int ans=A+1;
	for(int i=0;i<=A;++i)
		for(int j=1;i+j<=A and j<B;++j)
			ans=(ans+1ll*c[B-1][j]*s[j-1][i])%p;
	printf("%d\n",ans);
	return 0;
}