eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Set Division

Set Division

Ruslan has \textbf{K} friends. And all of them have birthday tomorrow. He has bought \textbf{N} different photo albums yesterday, and wants to present these photo albums to his friends. Of course, he can't give less than \textbf{1} photo album to anybody. Your task is to calculate how many possible ways is there to do it. All photo albums are different. Two distributions are considered the same if they differ only by order of albums in the gifts or by the persons receiving gifts. \InputFile In the only line of the input there are two numbers separated by a space --- \textbf{1} ≤ \textbf{N} ≤ \textbf{1000000000}, \textbf{1} ≤ \textbf{K} ≤ \textbf{min(N, 10)}. \OutputFile Output should contain one number --- the number of possible ways to distribute the albums modulo \textbf{2007}.
Ліміт часу 0.25 секунд
Ліміт використання пам'яті 256 MiB
Вхідні дані #1
3 2
Вихідні дані #1
3
Джерело Izhevsk STU Contest, Petrozavodsk training camp, February 6, 2009