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

mod = 1000000007

def pow(x, n):
    ret = 1
    while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
    return ret

fac = [1]
inv = [1]
for i in range(n * 2):
    fac.append(fac[-1] * (i + 1) % mod)
    inv.append(pow(fac[-1], mod - 2))

def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return (fac[n] * inv[k] * inv[n - k]) % mod

x = max(0, n - k - 1)
ret = cmb(n * 2 - 1, n - 1)
for i in range(x):
    ret = (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod
print(ret)
 n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k mod = 1000000007 mod 1000000007 def pow(x, n):
    ret = 1
    while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
    return ret pow ret = 1 ret 1 while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
     n > 0 n 0 if (n & 1) == 1:
            ret = (ret * x) % mod
         (n & 1) == 1 n & 1 n 1 1 ret = (ret * x) % mod ret (ret * x) % mod ret * x ret x mod x = (x * x) % mod x (x * x) % mod x * x x x mod n //= 2 n 2 return ret ret x x n n fac = [1] fac [1] 1 inv = [1] inv [1] 1 for i in range(n * 2):
    fac.append(fac[-1] * (i + 1) % mod)
    inv.append(pow(fac[-1], mod - 2)) i range(n * 2) range n * 2 n 2 fac.append(fac[-1] * (i + 1) % mod) fac.append fac append fac[-1] * (i + 1) % mod fac[-1] * (i + 1) fac[-1] fac -1 i + 1 i 1 mod inv.append(pow(fac[-1], mod - 2)) inv.append inv append pow(fac[-1], mod - 2) pow fac[-1] fac -1 mod - 2 mod 2 def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return (fac[n] * inv[k] * inv[n - k]) % mod cmb if k < 0 or k > n:
        return 0
     k < 0 or k > n k < 0 k 0 k > n k n return 0 0 return (fac[n] * inv[k] * inv[n - k]) % mod (fac[n] * inv[k] * inv[n - k]) % mod fac[n] * inv[k] * inv[n - k] fac[n] * inv[k] fac[n] fac n inv[k] inv k inv[n - k] inv n - k n k mod n n k k x = max(0, n - k - 1) x max(0, n - k - 1) max 0 n - k - 1 n - k n k 1 ret = cmb(n * 2 - 1, n - 1) ret cmb(n * 2 - 1, n - 1) cmb n * 2 - 1 n * 2 n 2 1 n - 1 n 1 for i in range(x):
    ret = (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod i range(x) range x ret = (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod ret (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod ret - cmb(n, i + 1) * cmb(n - 1, i) ret cmb(n, i + 1) * cmb(n - 1, i) cmb(n, i + 1) cmb n i + 1 i 1 cmb(n - 1, i) cmb n - 1 n 1 i mod print(ret) print ret inv = [1] [1] inv ret = (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod ret def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return (fac[n] * inv[k] * inv[n - k]) % mod def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return (fac[n] * inv[k] * inv[n - k]) % mod cmb fac = [1] [1] fac k = map(int, input().split()) map(int, input().split()) k ret = cmb(n * 2 - 1, n - 1) cmb(n * 2 - 1, n - 1) ret n, k = map(int, input().split()) map(int, input().split()) n mod = 1000000007 1000000007 mod def pow(x, n):
    ret = 1
    while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
    return ret def pow(x, n):
    ret = 1
    while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
    return ret pow x = max(0, n - k - 1) max(0, n - k - 1) x
n, k = map(int, input().split())

mod = 1000000007

def pow(x, n):
    ret = 1
    while n > 0:
        if (n & 1) == 1:
            ret = (ret * x) % mod
        x = (x * x) % mod
        n //= 2
    return ret

fac = [1]
inv = [1]
for i in range(n * 2):
    fac.append(fac[-1] * (i + 1) % mod)
    inv.append(pow(fac[-1], mod - 2))

def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return (fac[n] * inv[k] * inv[n - k]) % mod

x = max(0, n - k - 1)
ret = cmb(n * 2 - 1, n - 1)
for i in range(x):
    ret = (ret - cmb(n, i + 1) * cmb(n - 1, i)) % mod
print(ret)

