#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
const int N = 1e5;
array<int, N + 100> cnt;
int main() {
  ll n, m;
  cin >> n >> m;
  ll sum = 0;
  ll mx = (1 + n) * n / 2;
  for (int i = 0; i < m; i++) {
    ll x;
    cin >> x;
    if (cnt[x]) {
      cnt[x]++;
      printf("0");
    } else {
      sum += x;
      cnt[x] = 1;
      if (sum == mx) {
        printf("1");
        for (ll j = 1; j <= n; j++) {
          cnt[j]--;
          if (!cnt[j]) sum -= j;
        }
      } else
        printf("0");
    }
  }
  return 0;
}
