#include <bits/stdc++.h>
using namespace std;
string S;
int n, k;
int RA[2000010], tempRA[2000010];
int SA[2000010], tempSA[2000010];
int c[2000010];
int Phi[2000010], PLCP[2000010], LCP[2000010][23];
void countingSort(int k) {
  int i, sum, maxi = max(300, n);
  memset(c, 0, sizeof c);
  for (i = 0; i < n; i++) c[i + k < n ? RA[i + k] : 0]++;
  for (i = sum = 0; i < maxi; i++) {
    int t = c[i];
    c[i] = sum;
    sum += t;
  }
  for (i = 0; i < n; i++)
    tempSA[c[SA[i] + k < n < n ? RA[SA[i] + k] : 0]++] = SA[i];
  for (i = 0; i < n; i++) SA[i] = tempSA[i];
}
void constructSA() {
  int i, k, r;
  for (i = 0; i < n; i++) RA[i] = S[i];
  for (i = 0; i < n; i++) SA[i] = i;
  for (k = 1; k < n; k <<= 1) {
    countingSort(k);
    countingSort(0);
    tempRA[SA[0]] = r = 0;
    for (i = 1; i < n; i++)
      tempRA[SA[i]] =
          (RA[SA[i]] == RA[SA[i - 1]] && RA[SA[i] + k] == RA[SA[i - 1] + k])
              ? r
              : ++r;
    for (i = 0; i < n; i++) RA[i] = tempRA[i];
    if (RA[SA[n - 1]] == n - 1) break;
  }
}
void computeLCP() {
  int i, L;
  Phi[SA[0]] = -1;
  for (i = 1; i < n; i++) Phi[SA[i]] = SA[i - 1];
  for (i = L = 0; i < n; i++) {
    if (Phi[i] == -1) {
      PLCP[i] = 0;
      continue;
    }
    while (S[i + L] == S[Phi[i] + L]) L++;
    PLCP[i] = L;
    L = max(L - 1, 0);
  }
  for (i = 1; i < n; i++) LCP[i - 1][0] = PLCP[SA[i]];
  for (int i = 1; i < 20; i++) {
    for (int j = 0; j <= n - (1 << (i - 1)); j++) {
      LCP[j][i] = min(LCP[j][i - 1], LCP[j + (1 << (i - 1))][i - 1]);
    }
  }
}
int get_lcp(int i, int j) {
  i = RA[i];
  j = RA[j];
  if (i > j) swap(i, j);
  int ans = 1e9;
  int dis = j - i;
  for (int bit = 20; bit >= 0; bit--) {
    if ((1 << bit) <= dis) {
      ans = min(LCP[i][bit], LCP[j - (1 << bit)][bit]);
      break;
    }
  }
  return ans;
}
int pre[2000005];
char ch[2000005];
int main() {
  cin >> n >> k;
  scanf("%s", ch);
  S = (string)ch;
  S += '$';
  n++;
  constructSA();
  computeLCP();
  int N = n;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < N - 1; i++) {
    int id = 0;
    int id2 = id + (i + 1);
    int last = 0;
    int cnt = 1;
    int ok = 1;
    while (cnt < k) {
      if (id2 >= N) {
        ok = 0;
        break;
      }
      int r = get_lcp(id, id2);
      if (r < (i + 1)) {
        ok = 0;
        break;
      }
      cnt++;
      id2 += (i + 1);
    }
    if (ok && id2 < N) {
      int r = get_lcp(id, id2);
      r = min(r, i + 1);
      pre[max(0, id2 - 1)]++;
      pre[id2 + r]--;
    }
    if (ok && id2 == N) {
      pre[N - 1]++;
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (i > 0) pre[i] += pre[i - 1];
    if (pre[i] > 0)
      printf("1");
    else
      printf("0");
  }
}
