#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const long long zero = 5e5 + 100;
const long long maxn = (long long)zero * 2;
const long long maxm = (long long)1e7;
const int logn = 22;
const long long INF = 1e9 + 100;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-12;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, K;
  string str;
  while (cin >> n >> K >> str) {
    vector<int> mlen(n, 0);
    int last_i = 0;
    for (int i = 1; i < n; ++i) {
      while (last_i > 0 && str[last_i] != str[i]) last_i = mlen[last_i - 1];
      if (str[last_i] == str[i]) ++last_i;
      mlen[i] = last_i;
    }
    string ans(n, '0');
    for (int i = 1; i < n; ++i) {
      int len = mlen[i];
      int pre = i + 1 - len;
      if ((i + 1) % pre == 0) {
        int r = (i + 1) / pre;
        ans[i] = r / K - r % K >= 0 ? '1' : '0';
      } else {
        int r = (i + 1) / pre;
        ans[i] = r / K - r % K > 0 ? '1' : '0';
      }
    }
    ans[0] = K == 1 ? '1' : '0';
    cout << ans << endl;
  }
  return 0;
}
