#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int sa[1500000];
int c[1500000];
int temp[2][1500000];
void suffix_array(char* t, int N) {
  int A = 128;
  int* rank = temp[0];
  int* sa2 = temp[1];
  for (int i = 0; i < A; ++i) c[i] = 0;
  for (int i = 0; i < N; ++i) c[rank[i] = t[i]]++;
  for (int i = 1; i < A; ++i) c[i] += c[i - 1];
  for (int i = N - 1; i >= 0; --i) sa[--c[t[i]]] = i;
  for (int n = 1; n < N; n *= 2) {
    int r = 0;
    for (int i = N - n; i < N; ++i) sa2[r++] = i;
    for (int i = 0; i < N; ++i)
      if (sa[i] >= n) sa2[r++] = sa[i] - n;
    for (int i = 0; i < A; ++i) c[i] = 0;
    for (int i = 0; i < N; ++i) c[rank[i]]++;
    for (int i = 1; i < A; ++i) c[i] += c[i - 1];
    for (int i = N - 1; i >= 0; --i) sa[--c[rank[sa2[i]]]] = sa2[i];
    int*& new_rank = sa2;
    new_rank[sa[0]] = r = 0;
    for (int i = 1; i < N; ++i) {
      if (!(rank[sa[i - 1]] == rank[sa[i]] && sa[i - 1] + n < N &&
            rank[sa[i - 1] + n] == rank[sa[i] + n]))
        r++;
      new_rank[sa[i]] = r;
    }
    swap(rank, sa2);
    if (r == N - 1) break;
    A = r + 1;
  }
}
int lcpa[1500000];
void lcp_array(char* s, int N) {
  int* rank = temp[0];
  for (int i = 0; i < N; ++i) rank[sa[i]] = i;
  for (int i = 0, lcp = 0; i < N; i++)
    if (rank[i] == 0)
      lcpa[0] = 0;
    else {
      int j = sa[rank[i] - 1];
      if (lcp > 0) lcp--;
      while (s[i + lcp] == s[j + lcp]) {
        lcp++;
      }
      lcpa[rank[i]] = lcp;
    }
}
char s[1500000];
int ans[1500000];
int main() {
  int N, K;
  scanf("%d", &N), scanf("%d", &K);
  scanf("%s", s);
  if (K == 1) {
    for (int i = 0; i < (N); i++) {
      s[i] = '1';
    }
    puts(s);
    return 0;
  }
  suffix_array(s, N);
  lcp_array(s, N);
  int i = 0;
  while (i < N) {
    if (sa[i] == 0) break;
    i++;
  }
  int j = i + 1, lcp = N;
  while (j < N) {
    lcp = min(lcp, lcpa[j]);
    long long p = sa[j];
    if (p * K <= p + lcp) {
      ans[p * K - 1]++;
      ans[min(p + lcp, p * (K + 1))]--;
    }
    j++;
  }
  j = i - 1, lcp = N;
  while (j >= 0) {
    lcp = min(lcp, lcpa[j + 1]);
    long long p = sa[j];
    if (p * K <= p + lcp) {
      ans[p * K - 1]++;
      ans[min(p + lcp, p * (K + 1))]--;
    }
    j--;
  }
  for (int i = 0; i < (N); i++) {
    assert(ans[i] >= 0);
    ans[i + 1] += ans[i];
    if (ans[i])
      s[i] = '1';
    else
      s[i] = '0';
  }
  puts(s);
  return 0;
}
