#include <bits/stdc++.h>
using namespace std;
int a[2000010], c[2000010], b[2000010];
char d[2000010];
int main() {
  int k, n, ans, flag, tmp;
  cin >> k >> n;
  ans = 0;
  flag = 1;
  memset(c, 0, sizeof(c));
  memset(b, 0, sizeof(b));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    d[i] = '0';
    c[a[i]]++;
    b[c[a[i]]]++;
    if (b[c[a[i]]] == k) {
      d[i] = '1';
    }
    cout << d[i];
  }
  cout << endl;
  return 0;
}
