program problemA
  implicit none


integer(8) :: N,K, a,b,c,d,ans

read(*,*) N,K

ans=0
if (K<=N) then
  do while (K<=N)
    call ex(N-1,a)
    b=2*N-K+1
    call ex(N-K+1,c)
    call ex(K-1,d)
    ans=ans+a*b/(c*d)
    K=K+1
  end do
end if

ans=ans+1

if (K==1) ans=ans+1

write(*,*) mod(ans,10**9+7)










stop
end program


subroutine ex(n,k)
  implicit none

  integer(8), intent(in) :: n
  integer(8), intent(out) :: k
  integer(8) :: l, i

  l=1
  i=n

  do while (i>0)
    l=l*i
    i=i-1
  end do

  k=l

  return
end subroutine ex
