#include <bits/stdc++.h>
int main() {
  int n, m, a[100005], c[100005], d = 0;
  memset(c, 0, sizeof(c));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= m; i++) {
    if (!c[a[i]]) {
      c[a[i]]++;
      d++;
      if (d == n) {
        printf("1");
        for (int j = 1; j <= n; j++) {
          c[j]--;
          if (c[j] == 0) d--;
        }
      } else {
        printf("0");
      }
    } else {
      c[a[i]]++;
      printf("0");
    }
  }
  return 0;
}
