#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
int n;
int m;
int cnt[MAX_N];
int a[MAX_N];
int main() {
  scanf("%d %d", &m, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int diff = 0;
  for (int i = 1; i <= n; i++) {
    cnt[a[i]]++;
    if (cnt[a[i]] == 1) {
      diff++;
    }
    if (diff == m) {
      cout << 1;
      for (int j = 1; j <= m; j++) {
        cnt[j]--;
        if (cnt[j] == 0) {
          diff--;
        }
      }
    } else {
      cout << 0;
    }
  }
  return 0;
}
