#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, k, z[5000005], dif[5000005];
string s;
void zalgo(string cmp) {
  int l = 0, r = 0;
  for (int i = 1; i < cmp.length(); i++) {
    if (i > r) {
      int now = i;
      while (cmp[now] == cmp[now - i]) now++;
      z[i] = now - i;
      l = i, r = i + z[i] - 1;
    } else {
      int k = i - l;
      if (z[k] >= r - i + 1) {
        int now = r;
        while (cmp[now] == cmp[now - i]) now++;
        z[i] = now - i;
        l = i, r = i + z[i] - 1;
      } else
        z[i] = z[k];
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> s;
  zalgo(s);
  for (int i = 1; i <= n / k + 1; i++) {
    if (i * k - 1 <= min(z[i] + i - 1, i * (k + 1) - 1)) {
      dif[i * k - 1]++;
      dif[min(z[i] + i - 1, i * (k + 1) - 1) + 1]--;
    }
  }
  int now = 0;
  for (int i = 0; i < n; i++) {
    now += dif[i];
    if (now > 0)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  return 0;
}
