#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, m;
int a[maxn];
int b[maxn];
int ans[maxn];
int main() {
  cin >> n >> m;
  int num = 0;
  for (int i = 0; i < m; i++) {
    scanf("%d", a + i);
    if (b[a[i]] == 0) num++;
    b[a[i]]++;
    if (num == n) {
      ans[i] = 1;
      num = 0;
      for (int j = 1; j <= n; j++) {
        b[j]--;
        if (b[j] > 0) num++;
      }
    } else {
      ans[i] = 0;
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
