#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  bool b;
  unordered_set<int> s;
  long long int i, j, k, n, a = 0, ma = 0, mb = 1, ar[1000000] = {0}, p = 0;
  cin >> k >> n;
  for (i = 1; i <= n; i++) {
    cin >> j;
    s.insert(j);
    ar[j]++;
    if (j > ma) ma = j;
    if (i + 1 >= k and ma == k) {
      b = false;
      if (s.size() == k) b = true;
      if (b) {
        cout << 1;
        for (p = 1; p <= k; p++) {
          ar[p]--;
          if (ar[p] == 0) s.erase(p);
        }
      } else
        cout << 0;
    } else
      cout << 0;
  }
}
