#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 100, base = 1213, MOD = 1000 * 1000 * 1000 + 7;
long long n, k, a[N], power[N];
string s;
bool ans[N];
set<int> st;
long long sum(long long a, long long b) {
  return ((a + b) % MOD + MOD) % MOD;
  a += b;
  if (a < 0)
    a += MOD;
  else if (a >= MOD)
    a -= MOD;
  return a;
}
long long mul(long long a, long long b) {
  return 1LL * (a % MOD) * (b % MOD) % MOD;
}
long long get(int l, int r) {
  return sum(a[r], -mul(a[l - 1], power[r - l + 1]));
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> k >> s;
  s = "#" + s;
  for (int i = 1; i <= n; i++) a[i] = sum(mul(a[i - 1], base), s[i]);
  power[0] = 1;
  for (int i = 1; i < N; i++) power[i] = mul(power[i - 1], base);
  while (true) {
    break;
    int s, e;
    if (s + e == -2) break;
    cin >> s >> e;
    cerr << get(s, e) << '\n';
  }
  for (int i = 1; i <= n; i++) st.insert(i);
  for (int i = 1; i <= n; i++) {
    long long last = get(1, i);
    int cnt = 1;
    for (int j = 2 * i; j <= n && cnt < k; j += i)
      if (get(j - i + 1, j) != last)
        break;
      else
        cnt++;
    if (cnt == k) {
      int dex = k * i;
      while (st.lower_bound(dex) != st.end()) {
        int help = *st.lower_bound(dex);
        if (help > dex + i) break;
        if (help == dex || get(dex + 1, help) == get(1, help - dex)) {
          ans[help] = true;
          st.erase(help);
        } else
          break;
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i];
  return 0;
}
