#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1234567;
char s[MaxN];
int z[MaxN];
char res[MaxN];
int main(void) {
  int n, k;
  while (scanf(" %d %d", &n, &k) != EOF) {
    int l, r;
    int i, j;
    scanf(" %s", s);
    memset(z, 0, sizeof z);
    memset(res, '0', sizeof res);
    for (i = 1, l = 0, r = 0; i < n; i++) {
      if (i <= r) z[i] = min(r - i + 1, z[i - l]);
      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;
    }
    int last = 0;
    if (k == 1)
      memset(res, '1', sizeof res);
    else
      for (i = 0; i < n; i++)
        if (z[i] >= 1ll * (k - 1) * i) {
          for (j = max(1ll * i * k - 1, 1ll * last);
               j < 1ll * i * (k + 1) && j < n && j < i + z[i]; j++)
            res[j] = '1';
          last = j;
        }
    res[n] = 0;
    printf("%s\n", res);
  }
  return 0;
}
