#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 8;
int a[MX];
int c[MX];
int b[MX];
int all, r;
string ans;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    c[a[i]]++;
    b[c[a[i]]]++;
    if (b[c[a[i]]] == n)
      ans += "1";
    else
      ans += "0";
  }
  cout << ans;
  return 0;
}
