#include <bits/stdc++.h>
using namespace std;
vector<int> z_function(const string& s) {
  int N = (int)s.length();
  vector<int> z(N);
  for (int i = 1, L = 0, R = 0; i < N; ++i) {
    int k = 0;
    if (i <= R) k = min(R - i + 1, z[i - L]);
    while (i + k < N && s[k] == s[i + k]) ++k;
    if (i + k - 1 > R) L = i, R = i + k - 1;
    z[i] = k;
  }
  return z;
}
int A[1000004];
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, K;
  cin >> N >> K;
  string S;
  cin >> S;
  vector<int> z = z_function(S);
  z.push_back(0);
  for (int i = 1; i <= N; ++i) {
    long long len = i;
    if (z[i] >= len * (K - 1)) {
      int L = max(len * K - 1, 0LL);
      int R = min(len * (K + 1), (long long)i + z[i]);
      A[L]++;
      A[R]--;
    }
  }
  string res(N, '0');
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    sum += A[i];
    if (sum > 0) res[i] = '1';
  }
  cout << res << "\n";
  return 0;
}
