#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
void change(map<long long, long long> &m, long long n) {
  long long i;
  for (long long i = 1; i < n + 1; i++) {
    if (m[i] == 1)
      m.erase(i);
    else
      m[i]--;
  }
  return;
}
void solve() {
  long long n, i, l, t;
  cin >> n >> t;
  string ans = "";
  map<long long, long long> m;
  for (long long i = 0; i < t; i++) {
    cin >> l;
    m[l]++;
    if ((long long)m.size() == n) {
      ans += "1";
      change(m, n);
    } else {
      ans += "0";
    }
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
