#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch;
  int f = 1, x;
  while (ch = getchar(), !isdigit(ch))
    if (ch == '-') f = -1;
  x = (ch ^ 48);
  while (ch = getchar(), isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48);
  return x * f;
}
inline void write(int x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 ^ 48);
}
inline void writ(int x) {
  write(x);
  puts("");
}
int n, k, nxt[1000001];
string s;
bool check(int i, int j) {
  int up = i / k / j, down = ceil((i / (k + 1) + 1) / double(j));
  return up >= down || (i % (k + 1) == 0 && (i / (k + 1)) % j == 0);
}
signed main() {
  n = read(), k = read();
  cin >> s;
  for (int i = 2, j = 0; i <= n; ++i) {
    while (j > 0 && s[i - 1] != s[j]) j = nxt[j];
    if (s[i - 1] == s[j]) ++j;
    nxt[i] = j;
  }
  for (int i = (1); i <= (n); ++i) printf("%d", check(i, i - nxt[i]));
  return 0;
}
