#include<bits/stdc++.h>
#define ll unsigned long long
using namespace std;
ll n;
ll x[1000010];
ll s[1000010];
ll hh=1,tt=0;
ll k;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin>>n>>k;
for(int i=1;i<=n;i++){
cin>>x[i];
while(hh<=tt&&s[tt]+k<=i){
hh++;
}
while(hh<=tt&&x[s[tt]]<=x[i]){
tt--;
}
s[++tt]=i;
if(i>=k){
cout<<tt-hh+1<<'\n';
}
}
return 0;
}