#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[m];
  for (long long i = 0; i < m; i++) cin >> a[i];
  vector<int> b;
  map<long long, long long> x;
  for (long long i = 0; i < m; i++) {
    x[a[i]]++;
    if (x.size() == n) {
      cout << 1;
      set<int> s;
      for (auto it = x.begin(); it != x.end(); it++) {
        it->second--;
        if (it->second == 0) s.insert(it->first);
      }
      for (auto it = s.begin(); it != s.end(); it++) x.erase(*it);
    } else
      cout << 0;
  }
  return 0;
}
