rt,玄关
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
long long n, k, a[N];
deque<long long> q;
int main() {
cin >> n >> k;
for(int i = 1; i <= n; i ++) {
cin >> a[i];
}
for(int i = 1; i <= n; i ++) {
while(!q.empty() && a[q.back()] <= a[i]){
q.pop_back();
}
q.push_back(i);
while(!q.empty() && q.front() + k <= i){
q.pop_front();
}
if(i >= k){
cout << q.size() << '\n';
}
}
return 0;
}