#include <bits/stdc++.h>
using namespace std;
const int N = 2000005, M = 8000005;
int a[N], q[N], f[N], v[M], mx[M];
void add(int x, int l, int r, int ll, int rr) {
  if (r < ll || l > rr) return;
  if (ll <= l && r <= rr) {
    v[x]++;
    return;
  }
  if (v[x]) {
    v[2 * x] += v[x];
    v[2 * x + 1] += v[x];
    v[x] = 0;
  }
  int m = (l + r) / 2;
  add(x * 2, l, m, ll, rr);
  add(x * 2 + 1, m + 1, r, ll, rr);
  mx[x] = max(mx[x * 2] + v[x * 2], mx[x * 2 + 1] + v[x * 2 + 1]);
}
int qry(int x, int l, int r, int ll, int rr) {
  if (r < ll || l > rr) return 0;
  if (ll <= l && r <= rr) return v[x] + mx[x];
  if (v[x]) {
    v[2 * x] += v[x];
    v[2 * x + 1] += v[x];
    v[x] = 0;
  }
  int m = (l + r) / 2;
  return max(qry(2 * x, l, m, ll, rr), qry(2 * x + 1, m + 1, r, ll, rr));
}
int main() {
  int n, k, h = 0;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = n; i >= 1; i--) {
    while (h > 0 && a[q[h - 1]] <= a[i]) {
      f[q[h - 1]] = i;
      h--;
    }
    q[h++] = i;
  }
  for (int i = 1; i <= n; i++) f[i] = max(f[i], i - k);
  for (int i = 1; i <= n; i++) {
    add(1, 1, n, f[i] + 1, i);
    if (i >= k) printf("%d\n", qry(1, 1, n, i - k + 1, i));
  }
  return 0;
}
