#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#define el '\n'
#define base 31
typedef long long ll;
#define N 1000005
#define M 100005
#define mod 1000000007
#define TIME (1.0*clock()/CLOCKS_PER_SEC)
#define fi first
#define se second
#define name "SON.inp"
using namespace std;
////////////////////////////////////////////////
int n,k,i,j,h,ma,dp[40000];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
if(fopen(name,"r"))
{
freopen(name,"r",stdin);
//freopen("SON.out","w",stdout);
}
cin>>n>>k;
ma=0;
for(i = 0 ; i < n ; i ++ )
{
ma+=(1<<i);
dp[1<<i]=1;
}
// bit 1 dung de danh dau so do da duoc chon chua
for(i = 1 ; i < ma ; i ++ )
for(j = 0 ; j < n ; j ++ ) if( (i >> j) & 1 )
{
for(h=j-1 ; (h>=0) && j-h<=k ; h -- ) if(((i >> h) ^ 1) & 1) dp[i|(1<<h)]+=dp[i];
for(h=j+1 ; (h<n) && h-j<= k ; h ++ ) if(((i >> h) ^ 1) & 1) dp[i|(1<<h)]+=dp[i];
}
cout<<dp[ma];
cerr<<"\n--------------Verdict----------------\n";
cerr<<"Time elapse : "<<TIME<<"s\n";
return 0;
}