#include <bits/stdc++.h>
using namespace std;
const int MAX = 200010;
const long long MOD = (int)1e9 + 7;
const int INF = 1e9;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const long double EPS = 1e-8;
vector<int> zfunc(const string& s) {
  int n = s.size();
  vector<int> z(n);
  int x = 0, y = 0;
  for (int i = 1; i < n; i++) {
    z[i] = max(0, min(z[i - x], y - i + 1));
    while (i + z[i] < n and s[z[i]] == s[i + z[i]]) {
      x = i;
      y = i + z[i];
      z[i]++;
    }
  }
  return z;
}
int32_t main() {
  long long n, k;
  string s;
  cin >> n >> k;
  cin >> s;
  string t = s + "$" + s;
  vector<long long> delta(n + 10, 0);
  vector<int> z = zfunc(t);
  for (long long ab = 1; ab * k <= n; ab++) {
    bool win = true;
    long long idx = 0;
    for (long long cnt = 1; cnt <= k; cnt++) {
      if (idx >= n or z[idx + n + 1] < ab) win = false;
      idx += ab;
    }
    if (win) {
      long long resto = (idx < n) ? min(ab, 1ll * z[idx + n + 1]) : 0;
      delta[idx - 1]++;
      delta[idx + resto]--;
    }
  }
  long long val = 0;
  for (long long i = 0; i < n; i++) {
    val += delta[i];
    cout << !!val;
  }
  cout << '\n';
  return 0;
}
