from scipy.special import comb n,m=map(int,input().split()) print(comb(m+1,n+1,1)%1000000007)