#include <bits/stdc++.h>
using namespace std;

int f[2333][2333],n,k;
const int mod =1e9+7;
int main()
{
	scanf("%d%d",&n,&k);
	f[1][n-k]=1;for (int i=1;i<n-k;++i) f[1][n-k]=(f[1][n-k]<<1)%mod;
	for (int i=2;i<=n;++i)
	{
		f[i][0]=(f[i-1][0]+f[i-1][1])%mod;
		for (int j=1;j<=n+1;++j)
	         f[i][j]=(f[i][j-1]+f[i-1][j+1])%mod;
	}
	printf("%d",f[n][0]);
	return 0;
}