#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<queue>
#include<algorithm>
#include<stack>
#include<cstring>
#include<vector>
#include<list>
#include<set>
#include<map>
using namespace std;
#define ll long long
#define mod 1000000007
#define inf 999999999
#define pi 4*atan(1)
//#pragma comment(linker, "/STACK:102400000,102400000")
int scan()
{
int res = 0 , ch ;
while( !( ( ch = getchar() ) >= ‘0‘ && ch <= ‘9‘ ) )
{
if( ch == EOF ) return 1 << 30 ;
}
res = ch - ‘0‘ ;
while( ( ch = getchar() ) >= ‘0‘ && ch <= ‘9‘ )
res = res * 10 + ( ch - ‘0‘ ) ;
return res ;
}
void extend_Euclid(ll a, ll b, ll &x, ll &y)
{
if(b == 0)
{
x = 1;
y = 0;
return;
}
extend_Euclid(b, a % b, x, y);
ll tmp = x;
x = y;
y = tmp - (a / b) * y;
}
ll combine1(ll n,ll m) //计算组合数C(n,m)
{
ll sum=1; //线性计算
for(ll i=1,j=n;i<=m;i++,j--)
{
sum*=j;
sum%=mod;
ll x,y;
extend_Euclid(i,mod,x,y);
sum*=(x%mod+mod)%mod;
sum%=mod;
}
return sum;
}
int main()
{
ll x,y,z,i,t;
while(~scanf("%I64d%I64d",&x,&y))
{
ll n,k;
ll ans=0;
k=x-2;
n=(x+y)-4;
ans=combine1(n,k);
printf("%I64d\n",ans);
}
return 0;
}