#include <bits/stdc++.h>
using namespace std;
char a[1050000];
int p[1050000];
int n, k;
void getp() {
  p[1] = 0;
  for (int i = 2; i <= n; i++) {
    int j = p[i - 1];
    while (j && a[i] != a[j + 1]) j = p[j];
    if (a[i] == a[j + 1]) j++;
    p[i] = j;
  }
}
int main() {
  scanf("%d%d%s", &n, &k, a + 1);
  getp();
  for (int i = 1; i <= n; i++) {
    int l = i - p[i];
    int t = i / l;
    int x = (t / k) * l;
    int y = (t % k) * l + i - t * l;
    if (x >= y) {
      printf("1");
    } else
      printf("0");
  }
  printf("\n");
}
