#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int problem_freq[100505], contest_freq[100505];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  ;
  int n, m, x, i;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x;
    problem_freq[x]++;
    contest_freq[problem_freq[x]]++;
    contest_freq[problem_freq[x]] >= n ? cout << "1" : cout << "0";
  }
  return 0;
}
