mod = int(1e9) + 7 # <-- input modulo
maxf = 500000           # <-- input factional limitation

def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL

def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y

def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo

fact = [1 for _ in range(maxf+1)]
invf = [1 for _ in range(maxf+1)]

for i in range(maxf):
    fact[i+1] = (fact[i] * (i+1)) % mod
invf[-1] = inved(fact[-1])
for i in range(maxf, 0, -1):
    invf[i-1] = (invf[i] * i) % mod
n, k = map(int, input().split())
S = 0
if n <= k + 1:
    print(fact[2*n-1]*invf[n]*invf[n-1]%mod)
else:
    S = 0
    for i in range(min(n, k+1)):
        S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod
        S %= mod
    print(S*fact[n-1]*fact[n]%mod) mod = int(1e9) + 7 mod int(1e9) + 7 int(1e9) int 1e9 7 maxf = 500000 maxf 500000 def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL make_fact tmp = n tmp n i for i in range(k) for i in range(k) i range(k) range k for i in range(k) i perm = [i for i in range(k)] perm [i for i in range(k)] 0 for _ in range(k) for _ in range(k) _ range(k) range k for _ in range(k) 0 L = [0 for _ in range(k)] L [0 for _ in range(k)] for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
     i range(k) range k L[i] = tmp % (i + 1) L[i] L i tmp % (i + 1) tmp i + 1 i 1 tmp //= i + 1 tmp i + 1 i 1 0 for _ in range(k) for _ in range(k) _ range(k) range k for _ in range(k) 0 LL = [0 for _ in range(k)] LL [0 for _ in range(k)] for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
     i range(k) range k LL[i] = perm[L[-i-1]] LL[i] LL i perm[L[-i-1]] perm L[-i-1] L -i-1 -i i 1 for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
     j range(L[-i-1]+1, k) range L[-i-1]+1 L[-i-1] L -i-1 -i i 1 1 k perm[j-1] = perm[j] perm[j-1] perm j-1 j 1 perm[j] perm j return LL LL n n k k def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y doubling y = 1 y 1 base = n base n tmp = m tmp m while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
     tmp != 0 tmp 0 if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
         tmp % 2 == 1 tmp % 2 tmp 2 1 y *= base y base if modulo > 0:
                y %= modulo
         modulo > 0 modulo 0 y %= modulo y modulo base *= base base base if modulo > 0:
            base %= modulo
         modulo > 0 modulo 0 base %= modulo base modulo tmp //= 2 tmp 2 return y y n n m m modulo=mod modulo mod def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo inved x, y, u, v, k, l = 1, 0, 0, 1, a, modulo x 1 y 0 u 0 v 1 k a l modulo while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
     l != 0 l 0 x, y, u, v = u, v, x - u * (k // l), y - v * (k // l) x u y v u x - u * (k // l) x u * (k // l) u k // l k l v y - v * (k // l) y v * (k // l) v k // l k l k, l = l, k % l k l l k % l k l return x % modulo x % modulo x modulo a a modulo=mod modulo mod 1 for _ in range(maxf+1) for _ in range(maxf+1) _ range(maxf+1) range maxf+1 maxf 1 for _ in range(maxf+1) 1 fact = [1 for _ in range(maxf+1)] fact [1 for _ in range(maxf+1)] 1 for _ in range(maxf+1) for _ in range(maxf+1) _ range(maxf+1) range maxf+1 maxf 1 for _ in range(maxf+1) 1 invf = [1 for _ in range(maxf+1)] invf [1 for _ in range(maxf+1)] for i in range(maxf):
    fact[i+1] = (fact[i] * (i+1)) % mod i range(maxf) range maxf fact[i+1] = (fact[i] * (i+1)) % mod fact[i+1] fact i+1 i 1 (fact[i] * (i+1)) % mod fact[i] * (i+1) fact[i] fact i i+1 i 1 mod invf[-1] = inved(fact[-1]) invf[-1] invf -1 inved(fact[-1]) inved fact[-1] fact -1 for i in range(maxf, 0, -1):
    invf[i-1] = (invf[i] * i) % mod i range(maxf, 0, -1) range maxf 0 -1 invf[i-1] = (invf[i] * i) % mod invf[i-1] invf i-1 i 1 (invf[i] * i) % mod invf[i] * i invf[i] invf i i mod n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k S = 0 S 0 if n <= k + 1:
    print(fact[2*n-1]*invf[n]*invf[n-1]%mod)
else:
    S = 0
    for i in range(min(n, k+1)):
        S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod
        S %= mod
    print(S*fact[n-1]*fact[n]%mod) n <= k + 1 n k + 1 k 1 print(fact[2*n-1]*invf[n]*invf[n-1]%mod) print fact[2*n-1]*invf[n]*invf[n-1]%mod fact[2*n-1]*invf[n]*invf[n-1] fact[2*n-1]*invf[n] fact[2*n-1] fact 2*n-1 2*n 2 n 1 invf[n] invf n invf[n-1] invf n-1 n 1 mod S = 0 S 0 for i in range(min(n, k+1)):
        S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod
        S %= mod
     i range(min(n, k+1)) range min(n, k+1) min n k+1 k 1 S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod S invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod invf[i]*invf[i]*invf[n-i-1]*invf[n-i] invf[i]*invf[i]*invf[n-i-1] invf[i]*invf[i] invf[i] invf i invf[i] invf i invf[n-i-1] invf n-i-1 n-i n i 1 invf[n-i] invf n-i n i mod S %= mod S mod print(S*fact[n-1]*fact[n]%mod) print S*fact[n-1]*fact[n]%mod S*fact[n-1]*fact[n] S*fact[n-1] S fact[n-1] fact n-1 n 1 fact[n] fact n mod def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y doubling S = 0 0 S def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL make_fact fact = [1 for _ in range(maxf+1)] [1 for _ in range(maxf+1)] fact maxf = 500000 500000 maxf def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo inved invf = [1 for _ in range(maxf+1)] [1 for _ in range(maxf+1)] invf k = map(int, input().split()) map(int, input().split()) k S %= mod mod S mod = int(1e9) + 7 int(1e9) + 7 mod n, k = map(int, input().split()) map(int, input().split()) n S = 0 0 S S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod S
mod = int(1e9) + 7 # <-- input modulo
maxf = 500000           # <-- input factional limitation

def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL

def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y

def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo

fact = [1 for _ in range(maxf+1)]
invf = [1 for _ in range(maxf+1)]

for i in range(maxf):
    fact[i+1] = (fact[i] * (i+1)) % mod
invf[-1] = inved(fact[-1])
for i in range(maxf, 0, -1):
    invf[i-1] = (invf[i] * i) % mod
n, k = map(int, input().split())
S = 0
if n <= k + 1:
    print(fact[2*n-1]*invf[n]*invf[n-1]%mod)
else:
    S = 0
    for i in range(min(n, k+1)):
        S += invf[i]*invf[i]*invf[n-i-1]*invf[n-i]%mod
        S %= mod
    print(S*fact[n-1]*fact[n]%mod)