#include <bits/stdc++.h>
namespace io {
int F() {
  int F = 1, n = 0;
  char ch;
  while ((ch = getchar()) != '-' && (ch < '0' || ch > '9'))
    ;
  ch == '-' ? F = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') n = n * 10 + ch - '0';
  return F ? n : -n;
}
long long G() {
  long long F = 1, n = 0;
  char ch;
  while ((ch = getchar()) != '-' && (ch < '0' || ch > '9'))
    ;
  ch == '-' ? F = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') n = n * 10 + ch - '0';
  return F ? n : -n;
}
}  // namespace io
int R(int l, int r) { return (rand() << 15 | rand()) % (r - l + 1) + l; }
char s[1111111];
int f[1111111];
struct edge {
  int to;
  int next;
} e[3333333];
int pe = 1111111;
void insert(int a, int to) {
  e[pe] = (edge){to, e[a].next};
  e[a].next = pe++;
}
char ans[1111111];
int st[1111111], ts;
int n, k;
void dfs(int o) {
  st[++ts] = o;
  if (o) {
    int L = (o + k) / (k + 1), R = o / k;
    int l = o - R, r = o - L;
    if (std::lower_bound(st + 1, st + ts + 1, l) !=
        std::upper_bound(st + 1, st + ts + 1, r))
      ans[o] = '1';
  }
  for (register int p = e[o].next; p; p = e[p].next) dfs(e[p].to);
  st[ts--] = 0;
}
int main() {
  n = io::F(), k = io::F();
  scanf("%s", s + 1);
  f[0] = -1;
  for (register int i = 2; i <= n; ++i) {
    int p = f[i - 1];
    for (; p != -1 && s[p + 1] != s[i]; p = f[p])
      ;
    f[i] = p + 1;
  }
  for (register int i = 1; i <= n; ++i) insert(f[i], i), ans[i] = '0';
  if (k == 1) {
    for (register int i = 1; i <= n; ++i) ans[i] = '1';
    puts(ans + 1);
    return 0;
  }
  dfs(0);
  puts(ans + 1);
  return 0;
}
