def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
mod=10**9+7
def bp(a,n):
        r=1
        while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
        return r
[n,k]=i2()
if n<=k:
   x=1
   for i in range(n-1):
      x*=2*n-1-i
      x%=mod
   y=1
   for i in range(n-1):
      y*=i+1
      y%=mod
   print((x*bp(y,10**9+5))%mod)   
   
else:
   x=1
   y=1
   t=1
   for i in range(k):
      t*=i+1
      t%=mod
      y*=n-1-i
      y%=mod
      y*=n-i
      y%=mod
      c=bp(t,10**9+5)
      x+=y*c*c
      x%=mod
   print(x)    def i1():
 return int(input()) i1 return int(input()) int(input()) int input() input def i2():
 return [int(i) for i in input().split()] i2 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i return [int(i) for i in input().split()] [int(i) for i in input().split()] mod=10**9+7 mod 10**9+7 10**9 10 9 7 def bp(a,n):
        r=1
        while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
        return r bp r=1 r 1 while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
         n if n%2:
              r=r*a%mod
            n%2 n 2 r=r*a%mod r r*a%mod r*a r a mod a=a*a%mod a a*a%mod a*a a a mod n>>=1 n 1 return r r a a n n [n,k]=i2() [n,k] n k i2() i2 if n<=k:
   x=1
   for i in range(n-1):
      x*=2*n-1-i
      x%=mod
   y=1
   for i in range(n-1):
      y*=i+1
      y%=mod
   print((x*bp(y,10**9+5))%mod)   
   
else:
   x=1
   y=1
   t=1
   for i in range(k):
      t*=i+1
      t%=mod
      y*=n-1-i
      y%=mod
      y*=n-i
      y%=mod
      c=bp(t,10**9+5)
      x+=y*c*c
      x%=mod
   print(x)    n<=k n k x=1 x 1 for i in range(n-1):
      x*=2*n-1-i
      x%=mod
    i range(n-1) range n-1 n 1 x*=2*n-1-i x 2*n-1-i 2*n-1 2*n 2 n 1 i x%=mod x mod y=1 y 1 for i in range(n-1):
      y*=i+1
      y%=mod
    i range(n-1) range n-1 n 1 y*=i+1 y i+1 i 1 y%=mod y mod print((x*bp(y,10**9+5))%mod) print (x*bp(y,10**9+5))%mod x*bp(y,10**9+5) x bp(y,10**9+5) bp y 10**9+5 10**9 10 9 5 mod x=1 x 1 y=1 y 1 t=1 t 1 for i in range(k):
      t*=i+1
      t%=mod
      y*=n-1-i
      y%=mod
      y*=n-i
      y%=mod
      c=bp(t,10**9+5)
      x+=y*c*c
      x%=mod
    i range(k) range k t*=i+1 t i+1 i 1 t%=mod t mod y*=n-1-i y n-1-i n-1 n 1 i y%=mod y mod y*=n-i y n-i n i y%=mod y mod c=bp(t,10**9+5) c bp(t,10**9+5) bp t 10**9+5 10**9 10 9 5 x+=y*c*c x y*c*c y*c y c c x%=mod x mod print(x) print x y=1 1 y x=1 1 x y*=n-1-i n-1-i y c=bp(t,10**9+5) bp(t,10**9+5) c y*=n-i n-i y def i2():
 return [int(i) for i in input().split()] def i2():
 return [int(i) for i in input().split()] i2 y*=i+1 i+1 y def i1():
 return int(input()) def i1():
 return int(input()) i1 y%=mod mod y def bp(a,n):
        r=1
        while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
        return r def bp(a,n):
        r=1
        while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
        return r bp x*=2*n-1-i 2*n-1-i x x%=mod mod x y=1 1 y x%=mod mod x x+=y*c*c y*c*c x t=1 1 t x=1 1 x t%=mod mod t t*=i+1 i+1 t y%=mod mod y y%=mod mod y mod=10**9+7 10**9+7 mod
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
mod=10**9+7
def bp(a,n):
        r=1
        while(n):
           if n%2:
              r=r*a%mod
           a=a*a%mod
           n>>=1
        return r
[n,k]=i2()
if n<=k:
   x=1
   for i in range(n-1):
      x*=2*n-1-i
      x%=mod
   y=1
   for i in range(n-1):
      y*=i+1
      y%=mod
   print((x*bp(y,10**9+5))%mod)   
   
else:
   x=1
   y=1
   t=1
   for i in range(k):
      t*=i+1
      t%=mod
      y*=n-1-i
      y%=mod
      y*=n-i
      y%=mod
      c=bp(t,10**9+5)
      x+=y*c*c
      x%=mod
   print(x)   