$M=10**9 +  7

(n,k)=gets.split.map(&:to_i)

$fact = [1]

(1..2*n).each{|i|
    $fact[i] = $fact[i-1]*i
}

def comb(n,k)
    $fact[n] / $fact[n-k] / $fact[k] % $M
end
b=k
r=n-k

(1..k).each{|i|
    r0 = r - (i-1)
    b0 = b - i
    p comb(r0+i,i) * comb(b0+i-1,i-1) % $M
}