#include <bits/stdc++.h>
long long mod = 1e9 + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  map<long long, long long> freq, ss;
  cin >> n >> m;
  int q = 1;
  for (int i = 0; i < m; i++) {
    int in;
    cin >> in;
    freq[in]++;
    ss[freq[in]]++;
    if (ss[q] == n)
      cout << 1, q++;
    else
      cout << 0;
  }
  return 0;
}
