#include <bits/stdc++.h>
using namespace std;
string s;
int kmp[1000005];
int main() {
  int n, k;
  cin >> n >> k;
  cin >> s;
  s = " " + s;
  int t = 0;
  if (k == 1)
    cout << 1;
  else
    cout << 0;
  for (int i = 2; i <= n; i++) {
    while (t != 0) {
      if (s[t + 1] == s[i]) {
        break;
      } else {
        t = kmp[t];
      }
    }
    if (t == 0) {
      if (s[t + 1] == s[i])
        kmp[i] = ++t;
      else
        kmp[i] = 0;
    } else {
      kmp[i] = ++t;
    }
    long long int leng = i;
    long long int div = i - t;
    long long int fr = leng % ((k + 1) * div) == 0 ? leng / ((k + 1) * div)
                                                   : leng / ((k + 1) * div) + 1;
    long long int bk = leng / (k * div);
    if (fr <= bk)
      cout << 1;
    else
      cout << 0;
  }
  return 0;
}
