#include <bits/stdc++.h>
using namespace std;
int prod(long int b[100001], long int n, long int base) {
  int flag = 1;
  for (int i = 1; i <= (n / 2) + 1; i++) {
    if ((b[i] - base) <= 0) {
      flag = flag * 0;
      return 0;
    }
    if ((b[n - i + 1] - base) <= 0) {
      flag = flag * 0;
      return 0;
    }
  }
  return flag;
}
int main() {
  long int n, m;
  cin >> n >> m;
  long int a[100005];
  long int b[100005];
  for (long int i = 1; i <= n; i++) {
    b[i] = 0;
  }
  long int base = 0;
  for (long int i = 0; i < m; i++) {
    cin >> a[i];
    b[a[i]]++;
    if (prod(b, n, base) == 1) {
      cout << 1;
      base++;
    } else {
      cout << 0;
    }
  }
  return 0;
}
