Asceticism

1부터 N까지의 순열을 문장으로 두고 하루 N개의 시간 구간에서 최적으로 읽을 때 정확히 K일이 걸리는 순열의 개수를 1e9+7로 나눈 나머지를 구한다.

어려움8동적 계획법조합론아직 제출이 없습니다시간 제한0.6초메모리 제한256 MB

문제

One day, JOI-kun got a time machine. He decided to go to Japan in the 9th century. He met Kukai, one of the most famous priests in Japan at the moment. The priest wanted to develop the new way of training.

His training is done in the following way:

  • Kukai reads the sutra with N sentences. These sentences are ordered, and he has to read in order.
  • Each sentence has one integer between 1 and N, inclusive. No two different sentences have the same number.
  • He has to read the sentence with the integer i (1 ≤ i ≤ N) in the i-th period among the N equally divided time periods in a day. Each sentence is so short that it is always possible for him to read a sentence in a period.

Kukai wants to read the whole sutra as fast as possible. However, how many days it takes for him to finish depends on the integers on the sentences in the sutra. JOI-kun was asked by Kukai to count the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally.

Given the number of sentences N and an integer K, calculate the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally, modulo 1 000 000 007.

입력

Read the following data from the standard input.

  • The first line of input contains N and K, separated by a single space.

출력

Print the number of possible ways of integers on the sentences that takes Kukai exactly K days to finish reading, if he reads optimally, modulo 1 000 000 007.

제한

  • 1 ≤ N ≤ 100 000.
  • 1 ≤ K ≤ N.