#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  int k = m / n;
  int index = 1;
  vector<long long> sum(1000001);
  long long ans = n * (n + 1);
  ans /= 2;
  map<int, int> d;
  vector<int> a(m);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    d[a[i]]++;
    sum[d[a[i]]] += a[i];
    if (sum[index] == ans) {
      cout << "1";
      index++;
    } else {
      cout << "0";
    }
  }
  return 0;
}
