#include <bits/stdc++.h>
using namespace std;
vector<int> z_f(string s) {
  int n = s.length();
  vector<int> z(n);
  z[0] = n;
  int l = 0, r = 0;
  for (int i = 1; i < n; ++i) {
    z[i] = max(0, min(z[i - l], r - i + 1));
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
int main() {
  int n, k;
  cin >> n >> k;
  string ans = "";
  if (k == 1) {
    for (int i = 0; i < n; i++) ans += '1';
    cout << ans;
    return 0;
  }
  string s;
  cin >> s;
  vector<int> z = z_f(s);
  vector<int> ok(2 * n + 2);
  for (int i = 1; i < n; i++) {
    if (k - 1 <= z[i] / i) {
      ok[i * k - 1]++;
      ok[min(n, min(i * (k + 1), i + z[i]))]--;
    }
  }
  int cur = 0;
  for (int i = 0; i < n; i++) {
    cur += ok[i];
    ans += (cur != 0 ? '1' : '0');
  }
  cout << ans;
  return 0;
}
