n,k = map(int,input().split())

# Function of Combination mod M
# set n >= max p expected
M = 10**9+7


if k >= n-1:
    fac = [1]+[0]*(2*n-1)
    for i in range(1,2*n): fac[i] = fac[i-1]*i %M
    comb = lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M
    y = comb(2*n-1,n-1)
    
else:
    y = 1
    c1,c2=1,1
    for i in range(1,k+1):
        p = pow(i,M-2,M)
        c1 = c1*(n+1-i)*p%M
        c2 = c2*(n-i)*p%M
        y += c1*c2%M
        # y = (y+c1*c2)%M
print(y%M) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k M = 10**9+7 M 10**9+7 10**9 10 9 7 if k >= n-1:
    fac = [1]+[0]*(2*n-1)
    for i in range(1,2*n): fac[i] = fac[i-1]*i %M
    comb = lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M
    y = comb(2*n-1,n-1)
    
else:
    y = 1
    c1,c2=1,1
    for i in range(1,k+1):
        p = pow(i,M-2,M)
        c1 = c1*(n+1-i)*p%M
        c2 = c2*(n-i)*p%M
        y += c1*c2%M
        # y = (y+c1*c2)%M k >= n-1 k n-1 n 1 fac = [1]+[0]*(2*n-1) fac [1]+[0]*(2*n-1) [1] 1 [0]*(2*n-1) [0] 0 2*n-1 2*n 2 n 1 for i in range(1,2*n): fac[i] = fac[i-1]*i %M
     i range(1,2*n) range 1 2*n 2 n comb = lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M comb lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M (fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M) fac[p]*pow(fac[q],M-2,M) fac[p] fac p pow(fac[q],M-2,M) pow fac[q] fac q M-2 M 2 M pow(fac[p-q],M-2,M) pow fac[p-q] fac p-q p q M-2 M 2 M M p q y = comb(2*n-1,n-1) y comb(2*n-1,n-1) comb 2*n-1 2*n 2 n 1 n-1 n 1 y = 1 y 1 c1,c2=1,1 c1 1 c2 1 for i in range(1,k+1):
        p = pow(i,M-2,M)
        c1 = c1*(n+1-i)*p%M
        c2 = c2*(n-i)*p%M
        y += c1*c2%M
        # y = (y+c1*c2)%M i range(1,k+1) range 1 k+1 k 1 p = pow(i,M-2,M) p pow(i,M-2,M) pow i M-2 M 2 M c1 = c1*(n+1-i)*p%M c1 c1*(n+1-i)*p%M c1*(n+1-i)*p c1*(n+1-i) c1 n+1-i n+1 n 1 i p M c2 = c2*(n-i)*p%M c2 c2*(n-i)*p%M c2*(n-i)*p c2*(n-i) c2 n-i n i p M y += c1*c2%M y c1*c2%M c1*c2 c1 c2 M print(y%M) print y%M y M n,k = map(int,input().split()) map(int,input().split()) n c1 = c1*(n+1-i)*p%M c1*(n+1-i)*p%M c1 y += c1*c2%M c1*c2%M y p = pow(i,M-2,M) pow(i,M-2,M) p c2=1,1 1 c2 k = map(int,input().split()) map(int,input().split()) k M = 10**9+7 10**9+7 M c2 = c2*(n-i)*p%M c2*(n-i)*p%M c2 y = 1 1 y c1,c2=1,1 1 c1 comb = lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M comb fac = [1]+[0]*(2*n-1) [1]+[0]*(2*n-1) fac y = comb(2*n-1,n-1) comb(2*n-1,n-1) y
n,k = map(int,input().split())

# Function of Combination mod M
# set n >= max p expected
M = 10**9+7


if k >= n-1:
    fac = [1]+[0]*(2*n-1)
    for i in range(1,2*n): fac[i] = fac[i-1]*i %M
    comb = lambda p,q:(fac[p]*pow(fac[q],M-2,M)*pow(fac[p-q],M-2,M))%M
    y = comb(2*n-1,n-1)
    
else:
    y = 1
    c1,c2=1,1
    for i in range(1,k+1):
        p = pow(i,M-2,M)
        c1 = c1*(n+1-i)*p%M
        c2 = c2*(n-i)*p%M
        y += c1*c2%M
        # y = (y+c1*c2)%M
print(y%M)
