class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod


N, K = map(int, input().split())
mod = 10**9+7
c = Combi(4*10**5+100, mod)
if N <= K:
    print(c.com(2*N-1, N-1))
else:
    ans = c.com(2*N-1, N-1)
    for i in range(K+1, N):
        ans -= c.com(N-1, N-i-1)*c.com(N, i)
    print(ans % mod) class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod Combi def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

     __init__ 1 for _ in range(N+1) for _ in range(N+1) _ range(N+1) range N+1 N 1 for _ in range(N+1) 1 self.power = [1 for _ in range(N+1)] self.power self power [1 for _ in range(N+1)] 1 for _ in range(N+1) for _ in range(N+1) _ range(N+1) range N+1 N 1 for _ in range(N+1) 1 self.rev = [1 for _ in range(N+1)] self.rev self rev [1 for _ in range(N+1)] self.mod = mod self.mod self mod mod for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
         i range(2, N+1) range 2 N+1 N 1 self.power[i] = (self.power[i-1]*i) % self.mod self.power[i] self.power self power i (self.power[i-1]*i) % self.mod self.power[i-1]*i self.power[i-1] self.power self power i-1 i 1 i self.mod self mod self.rev[N] = pow(self.power[N], self.mod-2, self.mod) self.rev[N] self.rev self rev N pow(self.power[N], self.mod-2, self.mod) pow self.power[N] self.power self power N self.mod-2 self.mod self mod 2 self.mod self mod for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

     j range(N, 0, -1) range N 0 -1 self.rev[j-1] = (self.rev[j]*j) % self.mod self.rev[j-1] self.rev self rev j-1 j 1 (self.rev[j]*j) % self.mod self.rev[j]*j self.rev[j] self.rev self rev j j self.mod self mod self self N N mod mod def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

     com if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

     K < R K R return 0 0 return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod (self.power[K])*(self.rev[K-R])*(self.rev[R]) (self.power[K])*(self.rev[K-R]) self.power[K] self.power self power K self.rev[K-R] self.rev self rev K-R K R self.rev[R] self.rev self rev R self.mod self mod self self K K R R def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod pom if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod K < R K R return 0 0 return (self.power[K])*(self.rev[K-R]) % self.mod (self.power[K])*(self.rev[K-R]) % self.mod (self.power[K])*(self.rev[K-R]) self.power[K] self.power self power K self.rev[K-R] self.rev self rev K-R K R self.mod self mod self self K K R R N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K mod = 10**9+7 mod 10**9+7 10**9 10 9 7 c = Combi(4*10**5+100, mod) c Combi(4*10**5+100, mod) Combi 4*10**5+100 4*10**5 4 10**5 10 5 100 mod if N <= K:
    print(c.com(2*N-1, N-1))
else:
    ans = c.com(2*N-1, N-1)
    for i in range(K+1, N):
        ans -= c.com(N-1, N-i-1)*c.com(N, i)
    print(ans % mod) N <= K N K print(c.com(2*N-1, N-1)) print c.com(2*N-1, N-1) c.com c com 2*N-1 2*N 2 N 1 N-1 N 1 ans = c.com(2*N-1, N-1) ans c.com(2*N-1, N-1) c.com c com 2*N-1 2*N 2 N 1 N-1 N 1 for i in range(K+1, N):
        ans -= c.com(N-1, N-i-1)*c.com(N, i)
     i range(K+1, N) range K+1 K 1 N ans -= c.com(N-1, N-i-1)*c.com(N, i) ans c.com(N-1, N-i-1)*c.com(N, i) c.com(N-1, N-i-1) c.com c com N-1 N 1 N-i-1 N-i N i 1 c.com(N, i) c.com c com N i print(ans % mod) print ans % mod ans mod N, K = map(int, input().split()) map(int, input().split()) N mod = 10**9+7 10**9+7 mod c = Combi(4*10**5+100, mod) Combi(4*10**5+100, mod) c class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod Combi K = map(int, input().split()) map(int, input().split()) K ans -= c.com(N-1, N-i-1)*c.com(N, i) c.com(N-1, N-i-1)*c.com(N, i) ans ans = c.com(2*N-1, N-1) c.com(2*N-1, N-1) ans
class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod

    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod

    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod


N, K = map(int, input().split())
mod = 10**9+7
c = Combi(4*10**5+100, mod)
if N <= K:
    print(c.com(2*N-1, N-1))
else:
    ans = c.com(2*N-1, N-1)
    for i in range(K+1, N):
        ans -= c.com(N-1, N-i-1)*c.com(N, i)
    print(ans % mod)