#include <bits/stdc++.h>
template <class t>
void maxi(t &x, t y) {
  if (x < y) x = y;
}
template <class t>
void mini(t &x, t y) {
  if (x > y) x = y;
}
using namespace std;
int n, m, a[300005], cnt[300005], cons, to[300005];
char c[300005];
int main() {
  ios::sync_with_stdio(0);
  cout << setprecision(10) << fixed;
  cin >> n >> m;
  for (int(i) = 0; (i) < (m); (i)++) {
    int a;
    cin >> (a);
    ;
    cnt[a]++;
    to[cnt[a] - 1]++;
    if (to[cons] == n) {
      cons++;
      c[i] = 1;
    }
  }
  for (int(i) = 0; (i) < (m); (i)++) c[i] += '0';
  cout << c << endl;
  return 0;
}
