#include <bits/stdc++.h>
int n, k, f[1000010];
char s[1000010];
using namespace std;
void getf(char *s) {
  int j = 0;
  for (int i = 2; i <= n; i++) {
    while (j && s[i] != s[j + 1]) j = f[j];
    if (s[i] == s[j + 1]) j++;
    f[i] = j;
  }
}
bool work(int i, int cir) {
  int x = i / cir;
  if (i % cir)
    return x / k > x % k;
  else
    return x / k >= x % k;
}
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", s + 1);
  getf(s);
  for (int i = 1; i <= n; i++) printf("%d", work(i, i - f[i]));
  return 0;
}
