AtCoder Regular Contest 068
F
Solitaire
AtCoder
⌀ 3042
原题
← E→
翻译中…

Problem Statement

翻译中…

Snuke has decided to play with $N$ cards and a deque (that is, a double-ended queue). Each card shows an integer from $1$ through $N$, and the deque is initially empty.

翻译中…

Snuke will insert the cards at the beginning or the end of the deque one at a time, in order from $1$ to $N$. Then, he will perform the following action $N$ times: take out the card from the beginning or the end of the deque and eat it.

翻译中…

Afterwards, we will construct an integer sequence by arranging the integers written on the eaten cards, in the order they are eaten. Among the sequences that can be obtained in this way, find the number of the sequences such that the $K$-th element is $1$. Print the answer modulo $10^{9} + 7$.

翻译中…

Constraints

翻译中…
  • $1 ≦ K ≦ N ≦ 2{,}000$
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N K

翻译中…

Output

翻译中…

Print the answer modulo $10^{9} + 7$.

翻译中…

样例

Input #1
2 1
Output #1
1
There is one sequence satisfying the condition: $1,2$. One possible way to obtain this sequence is the following: - Insert both cards, $1$ and $2$, at the end of the deque. - Eat the card at the beginning of the deque twice.
Input #2
17 2
Output #2
262144
Input #3
2000 1000
Output #3
674286644
题目信息
题号
arc068_d
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。