#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  set<long long> s;
  cin >> n >> m;
  vector<long long> v(n + 1, 0);
  for (long long i = 0; i < m; i++) {
    long long ele;
    cin >> ele;
    s.insert(ele);
    v[ele]++;
    if (s.size() == n) {
      cout << 1;
      s.clear();
      for (long long j = 1; j <= n; j++) {
        v[j]--;
        if (v[j] > 0) s.insert(j);
      }
    } else
      cout << 0;
  }
}
