#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000010;
int n;
int k;
int j;
char str[Maxn];
int Next[Maxn];
inline int Rikka_() {
  cin >> n >> k;
  scanf("%s", str + 1);
  for (int i = 2; i <= n; i++) {
    while (j && str[j + 1] != str[i]) j = Next[j];
    if (str[j + 1] == str[i]) j++;
    Next[i] = j;
  }
  for (int i = 1; i <= n; i++) {
    int now = i - Next[i];
    int d = i / now;
    if (i % now)
      cout << (((d / k) - (d % k)) > 0);
    else
      cout << (((d / k) - (d % k)) >= 0);
  }
  return 0;
}
int Rikka__ = Rikka_();
signed main() { ; }
