#Lutece1268. Open the lightings

Open the lightings

Migrated from Lutece 1268 Open the lightings

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

There are nn light(s) in a row.These lights are numbered 11 to nn from left to right.One of the lights are switched on.I wants to switch all the lights on. At each step I can switch a light on(this light should be switched off at that moment)if there's at least one "very close" light which is already switched on. More exactly: when No.ii light(this light is switched on now),No.jj light can be switched on(this light is switched off now) if and only if ij<=2|i-j|<=2. I knows the initial state of lights and I wonder how many different ways there exist to switch all the lights on.

Please find the required number of ways modulo 1000000007(109+7)1000000007 (10^9+7).

Input

The first line of the input contains two integers nn and mm where nn is the number of lights in the sequence and No.mm light are initially switched on,(1<=n<=1000,1<=m<=n)(1<=n<=1000,1<=m<=n).

Output

In the only line of the output print the number of different possible ways to switch on all the lights modulo 1000000007(109+7)1000000007 (10^9+7).

Samples

3 1
2

Resources

第七届ACM趣味程序设计竞赛第四场(正式赛)