#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9;
const int del = 728729;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
int n;
int k;
string s;
string t;
int st[maxn];
int fn[maxn];
int T = 0;
int kk;
int f[maxn];
vector<int> adg[maxn];
void dfs(int v) {
  st[v] = ++T;
  for (auto u : adg[v]) {
    dfs(u);
  }
  fn[v] = T;
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    t += '0';
  }
  f[1] = 0;
  for (int i = 1; i < n; i++) {
    while (kk > 0 && s[kk] != s[i]) {
      kk = f[kk];
    }
    if (s[kk] == s[i]) {
      kk += 1;
    }
    f[i + 1] = kk;
  }
  for (int i = 1; i <= n; i++) {
    adg[f[i]].push_back(i);
  }
  dfs(0);
  int pr = 0;
  for (int i = 1; k * i <= n; i++) {
    if (st[(k - 1) * i] <= st[k * i] && fn[k * i] <= fn[(k - 1) * i]) {
      int l = 0;
      int r = min(n - k * i + 1, i + 1);
      while (r - l > 1) {
        int md = (l + r) / 2;
        if (st[md] <= st[k * i + md] && fn[k * i + md] <= fn[md])
          l = md;
        else
          r = md;
      }
      for (int j = max(k * i, pr); j <= min(n, l + k * i); j++) {
        t[j - 1] = '1';
      }
      pr = max(l + k * i, pr);
    }
  }
  cout << t << "\n";
  return 0;
}
