#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, k;
char s[N];
int pre[N];
inline int test(int x) {
  int len = x - pre[x];
  int r = x / len, rr = (x - 1) / len + 1;
  int rig = r / k, lef = (rr - 1) / (k + 1) + 1;
  return lef <= rig;
}
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", s + 1);
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && s[j + 1] != s[i]) j = pre[j];
    if (s[j + 1] == s[i]) j++;
    pre[i] = j;
  }
  for (int i = 1; i <= n; i++) putchar('0' + test(i));
  return 0;
}
