#include <bits/stdc++.h>
using namespace std;
long long int mx(long long int a, long long int b) {
  if (a >= b) return a;
  return b;
}
long long int mn(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
long long int n, k;
char s[1000005];
long long int last[1000005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) cin >> s[i];
  last[1] = 0;
  for (long long int i = 2, j = 0; i <= n; i++) {
    while (j and s[j + 1] != s[i]) j = last[j];
    if (s[j + 1] == s[i]) j++;
    last[i] = j;
  }
  for (long long int i = 1; i <= n; i++) {
    if (i / (i - last[i]) / k > (i - 1) / (i - last[i]) / (k + 1))
      cout << 1;
    else
      cout << 0;
  }
  return 0;
}
