Sum Decomposition 2

Count ordered K-tuples of integers between 0 and N whose sum is N, modulo 1,000,000,000.

Medium5Dynamic programmingCombinatoricsMathInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

Write a program that counts the ways to add KK integers, each between 00 and NN inclusive, so that their sum is NN.

Order matters: 1+21+2 and 2+12+1 count as different ways. The same number may be used more than once.

Input

The first line contains two integers NN and KK (1N5,0001 \le N \le 5{,}000, 1K5,0001 \le K \le 5{,}000).

Output

Print the number of ways modulo 1,000,000,0001{,}000{,}000{,}000 on the first line.