#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int n,k;
int h[20];
int ans;
int main(){
#ifndef DEBUG
string FileName="round";
freopen((FileName+".in").c_str(),"r",stdin);
freopen((FileName+".out").c_str(),"w",stdout);
#endif
scanf("%d%d",&n,&k);
for(int i = 1; i <= n; i++)scanf("%d",&h[i]);
do{
int flag = 1;
for(int i = 1; i <= n; i++){
if(h[i]-h[i-1] > k){
flag = 0;
break;
}
}
ans += flag;
}while(next_permutation(h+1,h+n+1));
printf("%d",ans/n);
}