#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[100005] = {0}, b[100005] = {0};
  long long j;
  for (long long i = 0; i < m; i++) {
    cin >> j;
    a[j]++;
    b[a[j]]++;
    if (b[a[j]] == n)
      cout << "1";
    else
      cout << "0";
  }
  cout << endl;
}
