#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  long long a[m];
  for (long long& x : a) cin >> x;
  vector<long long> cnt(n + 1, 0);
  vector<long long> exist(m + 1, 0);
  string ans;
  for (long long i = 0; i < m; i++) {
    cnt[a[i]]++;
    exist[cnt[a[i]]]++;
    if (exist[cnt[a[i]]] == n) {
      ans += '1';
    } else
      ans += '0';
  }
  cout << ans << endl;
}
