#include <bits/stdc++.h>
using namespace std;
int nxt[1000010];
char a[1000010];
void getnext() {
  int i;
  for (i = 1; a[i]; i++) {
    int p = nxt[i];
    while (a[i] != a[p] && p) p = nxt[p];
    if (a[i] == a[p])
      nxt[i + 1] = p + 1;
    else
      nxt[i + 1] = 0;
  }
}
int main() {
  int i, n, k;
  scanf("%d%d%s", &n, &k, a);
  getnext();
  for (i = 1; i <= n; i++) {
    int cir = i - nxt[i];
    int l = 1 + (i - 1) / (cir + 1LL * k * cir), r = i / (1LL * k * cir);
    printf("%d", l <= r);
  }
  return 0;
}
