XYZ Obsessed

0

0 votes
Dynamic Programming, Medium
Problem

Zoro is totally obsessed with the letters XYZ. Obsession here is a bit literal. He loves having space between letters X and Z.

Due to his obsession he thought of a problem:

Given integers N and K. Find the number of strings of length exactly N and having exactly K sub sequences where X and Z have exactly 1 space in between. The string can contains all upper_case English alphabets.

Note

Answer may be too large so output it modulo 109+7

Input

A single line containing N and K.

Output

Print the desired output modulo 109+7.

Constraints

1N2000
0KN

Time Limit: 0.5
Memory Limit: 1024
Source Limit:
Explanation

The length of the string is 3 and we need only 1 desired subsequence. The strings can be:
XAZ ZAX
XBZ ZBX
.
.
.
.
XZZ ZZX

So there will be 54 strings possible.

Editor Image

?