#include <bits/stdc++.h>
using std::vector;
const int MAXN = 1e6 + 20;
namespace MyIO {
const int MAXB = 1 << 10;
char gbuf[MAXB], *ps = gbuf, *pt = gbuf;
char pbuf[MAXB + 1], *pp = pbuf;
struct Flusher {
  ~Flusher() { fwrite(pbuf, 1, pp - pbuf, stdout); }
} flusher;
inline char Getchar() {
  if (ps == pt) {
    ps = gbuf;
    pt = gbuf + fread(gbuf, 1, MAXB, stdin);
  }
  return (ps == pt) ? EOF : *ps++;
}
inline void Putchar(const char &ch) {
  if (pp == pbuf + MAXB) {
    pp = pbuf;
    fwrite(pbuf, 1, MAXB, stdout);
  }
  *pp++ = ch;
}
}  // namespace MyIO
int read() {
  int x = 0;
  char c = MyIO::Getchar();
  bool f = 0;
  while (c < '0' || c > '9')
    (c == '-') ? f = 1, c = MyIO::Getchar() : c = MyIO::Getchar();
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (48 ^ c), c = MyIO::Getchar();
  return (f) ? -x : x;
}
struct string {
  char data[MAXN];
  int len;
  int size() const { return len; }
  char &operator[](const int &index) { return data[index]; }
  char operator[](const int &index) const { return data[index]; }
};
void read_string(string &s) {
  char ch = MyIO::Getchar();
  while (ch < 'a' || ch > 'z') ch = MyIO::Getchar();
  s.len = 0;
  while (ch >= 'a' && ch <= 'z') s[s.len++] = ch, ch = MyIO::Getchar();
}
void kmp(const string &s1, const string &s2, vector<int> &pi,
         const vector<int> &pi_s2) {
  const int n1 = s1.size(), n2 = s2.size();
  pi[0] = (&s1 == &s2) ? 0 : (s1[0] == s2[0]);
  for (int i = 1; i < n1; ++i) {
    int j = pi[i - 1];
    if (j == n2) j = pi_s2[0 + j - 1];
    while (j && s2[0 + j - 1 + 1] != s1[i]) j = pi_s2[0 + j - 1];
    pi[i] = j + (s2[0 + j - 1 + 1] == s1[i]);
  }
}
int main() {
  int n = read(), k = read();
  string s;
  read_string(s);
  vector<int> pi(s.size(), 0);
  kmp(s, s, pi, pi);
  auto calc = [&](const int &N, const int &m) {
    int l = N / (1ll * (k + 1) * m) + (N % (1ll * (k + 1) * m) != 0),
        r = N / (1ll * k * m);
    return l <= r;
  };
  for (int i = 0; i < n; ++i) {
    int m = (i + 1) - pi[i];
    MyIO::Putchar('0' + calc(i + 1, m));
  }
}
