#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
const int dxx[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          dyy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long mod = 1000000007;
const int base = 311;
const int N = 1e6 + 5;
struct segtree {
  vector<int> st, lz;
  void kc(int n) {
    st.assign(4 * n + 5, 0);
    lz.assign(4 * n + 5, 0);
  }
  void down(int i) {
    int &t = lz[i];
    lz[i << 1] += t;
    lz[i << 1 | 1] += t;
    st[i << 1] += t;
    st[i << 1 | 1] += t;
    t = 0;
  }
  void upd(int i, int l, int r, int u, int v, int val) {
    if (u > r || v < l) return;
    if (u <= l && r <= v) {
      st[i] += val;
      lz[i] += val;
      return;
    }
    int mid = (l + r) >> 1;
    down(i);
    upd(i << 1, l, mid, u, v, val);
    upd(i << 1 | 1, mid + 1, r, u, v, val);
    st[i] = max(st[i << 1], st[i << 1 | 1]);
  }
  int get(int i, int l, int r, int u, int v, int val) {
    if (u > r || v < l) return 0;
    if (u <= l && r <= v) return st[i];
    down(i);
    int mid = (l + r) >> 1;
    return max(get(i << 1, l, mid, u, v, val),
               get(i << 1 | 1, mid + 1, r, u, v, val));
  }
};
int n, k, a[N];
vector<int> dsk[N];
int tin[N], tout[N], cnt = 0;
void dfs(int u) {
  tin[u] = ++cnt;
  for (int v : dsk[u]) dfs(v);
  tout[u] = cnt;
}
void gogo() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  stack<int> stk;
  stk.push(n + 1);
  a[n + 1] = 1e9;
  for (int i = n; i >= 1; --i) {
    while (((int)(stk).size()) && a[stk.top()] <= a[i]) stk.pop();
    dsk[stk.top()].push_back(i);
    stk.push(i);
  }
  dfs(n + 1);
  segtree st;
  st.kc(n + 5);
  for (int i = 1, j = 0; i + k - 1 <= n; ++i) {
    while (j < i + k - 1) {
      j++;
      st.upd(1, 1, n + 1, tin[j], tout[j], 1);
    }
    cout << st.st[1] << ' ';
    st.upd(1, 1, n + 1, tin[i], tout[i], -1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("sol"
            ".inp",
            "r")) {
    freopen(
        "sol"
        ".inp",
        "r", stdin);
    freopen(
        "sol"
        ".out",
        "w", stdout);
  }
  gogo();
}
