#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long const inf = 1e18, linf = 2e9, mod = 1e9 + 7, inf2 = 1e12;
int const mxn = 2e6 + 10;
long long mods[2] = {1088888881, 1111211111};
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
int n, k, f[mxn], ans;
string s;
void failure() {
  int j = f[0] = -1, i = 0;
  while (i < n) {
    while (j > -1 and s[i] != s[j]) j = f[j];
    j++, i++;
    f[i] = j;
  }
}
int check(int x) {
  if (x < k) return 0;
  int fr = x - f[x];
  int a = x % fr;
  int ted = x / fr;
  a += fr * (ted % k);
  fr = fr * (ted - ted % k) / k;
  if (fr >= a) return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  cin >> s;
  failure();
  for (int i = 1; i <= n; i++) cout << check(i);
}
