#include <bits/stdc++.h>
using namespace std;
long long n, k;
string mst;
vector<int> mmtc, sol;
long long ntm = 0;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> n >> k;
  cin >> mst;
  if (k == 1) {
    for (long long i = 0; i < (n); ++i) cout << "1";
    cout << "\n";
    return 0;
  }
  sol.resize(n, 0);
  mmtc.resize(n + 1, 0);
  long long lgst = 1;
  long long lgup = 0;
  while (lgup + 1 < n && mst[lgup] == mst[lgup + 1]) ++lgup;
  mmtc[0] = n;
  mmtc[1] = lgup;
  for (long long i = 2; i < n; i++) {
    if (lgst + lgup > i) mmtc[i] = mmtc[i - lgst];
    if (mmtc[i] + i >= lgst + lgup) {
      mmtc[i] = lgst + lgup - i;
      if (mmtc[i] < 0) mmtc[i] = 0;
      lgst = i;
      lgup = mmtc[i];
      while (lgup + i < n && mst[lgup] == mst[lgup + i]) ++lgup;
      mmtc[i] = lgup;
    }
  }
  for (long long i = 1; i < n; i++) {
    if (ntm < k * i - 1) ntm = k * i - 1;
    if (mmtc[i] + i >= i * k) {
      while (ntm < (k + 1) * i && ntm < mmtc[i] + i) {
        sol[ntm] = 1;
        ++ntm;
      }
    }
  }
  for (long long i = 0; i < (n); ++i) {
    cout << sol[i];
  }
  cout << "\n";
  return 0;
}
