#include <bits/stdc++.h>
using namespace std;
int nxt[1000005], n, k;
char str[1000005];
void getnext(char *x, int m, int *next) {
  int i, j;
  j = next[0] = -1;
  i = 0;
  while (i < m) {
    while (j != -1 && x[i] != x[j]) j = next[j];
    next[++i] = ++j;
  }
}
bool check(int x, int y) {
  int a = x / y;
  if (a / k > a % k) return true;
  if (x % (k + 1) == 0) {
    x /= (k + 1);
    if (x % y == 0) return true;
  }
  return false;
}
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", str);
  int len = strlen(str);
  getnext(str, len, nxt);
  for (int i = 1; i <= len; i++) {
    int minn = i - nxt[i];
    if (check(i, minn))
      putchar('1');
    else
      putchar('0');
  }
  return 0;
}
