#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 z[1500000];
void z_algorithm(char* s, int n) {
  int L = 0, R = 0;
  for (int i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
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;
  }
  z_algorithm(s, N);
  for (int p = (1); p <= (N - 1); p++) {
    int lcp = z[p];
    if ((long long)p * K <= p + lcp) {
      ans[p * K - 1]++;
      ans[min(p + lcp, p * (K + 1))]--;
    }
  }
  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;
}
