#include <bits/stdc++.h>
const int maxN = 1e6 + 10;
char s[maxN];
int p[maxN];
int last[maxN];
int main() {
  int n, k;
  scanf("%d%d%s", &n, &k, s + 1);
  printf("%d", k == 1);
  for (int tmp, i = 2; s[i]; i++) {
    tmp = p[i - 1];
    while (tmp && s[tmp + 1] != s[i]) tmp = p[tmp];
    if (s[tmp + 1] == s[i]) tmp++;
    p[i] = tmp;
    tmp = last[i - 1];
    while (tmp && s[tmp + 1] != s[i]) tmp = p[tmp];
    if (s[tmp + 1] == s[i]) tmp++;
    while (i > (k + 1) * (i - tmp) && tmp) tmp = p[tmp];
    last[i] = tmp;
    printf("%d", i / (i - tmp) >= k);
  }
  printf("\n");
  return 0;
}
