#include <bits/stdc++.h>
using namespace std;
char c[1000005];
int fail[1000005];
int n, k;
bool check(int i, int pd) {
  if (i % ((k + 1) * pd) == 0) return 1;
  int l = i / (k + 1), r = i / k;
  l = l / pd + 1;
  r = r / pd;
  if (l <= r)
    return 1;
  else
    return 0;
}
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", c + 1);
  fail[1] = 0;
  int f = 0;
  for (int i = 2; i <= n; i++) {
    while (f && c[f + 1] != c[i]) f = fail[f];
    if (c[f + 1] == c[i]) f++;
    fail[i] = f;
  }
  for (int i = 1; i <= n; i++) {
    if (check(i, i - fail[i]))
      cout << 1;
    else
      cout << 0;
  }
}
