MOD = 1000000007#い　つ　も　の
n,k = map(int,input().split())

nCk = 1#nC0
ans = 1

if k > n-1:
    k = n-1

for i in range(1,k+1,1):
    nCk = (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD
    ans = (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD

print(ans) MOD = 1000000007 MOD 1000000007 n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k nCk = 1 nCk 1 ans = 1 ans 1 if k > n-1:
    k = n-1 k > n-1 k n-1 n 1 k = n-1 k n-1 n 1 for i in range(1,k+1,1):
    nCk = (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD
    ans = (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD i range(1,k+1,1) range 1 k+1 k 1 1 nCk = (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD nCk (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD ((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007) (nCk*(n-i+1))%MOD nCk*(n-i+1) nCk n-i+1 n-i n i 1 MOD pow(i,1000000005,1000000007) pow i 1000000005 1000000007 MOD ans = (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD ans (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD ans%MOD ans MOD ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD (((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD (((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007) ((nCk*nCk)%MOD)*(n-i)%MOD ((nCk*nCk)%MOD)*(n-i) (nCk*nCk)%MOD nCk*nCk nCk nCk MOD n-i n i MOD pow(n,1000000005,1000000007) pow n 1000000005 1000000007 MOD MOD MOD print(ans) print ans nCk = (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD nCk ans = (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD ans n,k = map(int,input().split()) map(int,input().split()) n MOD = 1000000007 1000000007 MOD ans = 1 1 ans nCk = 1 1 nCk k = map(int,input().split()) map(int,input().split()) k k = n-1 n-1 k
MOD = 1000000007#い　つ　も　の
n,k = map(int,input().split())

nCk = 1#nC0
ans = 1

if k > n-1:
    k = n-1

for i in range(1,k+1,1):
    nCk = (((nCk*(n-i+1))%MOD)*pow(i,1000000005,1000000007))%MOD
    ans = (ans%MOD + ((((nCk*nCk)%MOD)*(n-i)%MOD)*pow(n,1000000005,1000000007)%MOD)%MOD)%MOD

print(ans)
