#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  while (scanf("%lld %lld", &n, &m) == 2) {
    int a[100005];
    for (long long i = 0; i < m; i++) {
      cin >> a[i];
    }
    long long x = n;
    int b[100005], mark[100005], cnt[100005];
    memset(cnt, 0, sizeof(cnt));
    memset(b, 0, sizeof(b));
    long long j = 1;
    for (long long i = 0; i < m; i++) {
      b[a[i]]++;
      cnt[b[a[i]]]++;
      if (cnt[j] == n) {
        cout << 1;
        j++;
      } else {
        cout << 0;
      }
    }
    cout << endl;
  }
  return 0;
}
