#include <bits/stdc++.h>
using namespace std;
int n, m;
int rep[100100];
int res[100100];
int main() {
  int ok = 0;
  cin >> n >> m;
  int a;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a);
    rep[a]++;
    if (rep[a] == 1) {
      ok++;
    }
    if (ok == n) {
      ok = 0;
      for (int j = 1; j <= n; j++) {
        rep[j]--;
        if (rep[j]) ok++;
      }
      res[i] = 1;
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d", res[i]);
  }
  return 0;
}
