#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a[m + 1], cnt[n + 1];
  for (int i = 1; i <= n; i++) cnt[i] = 0;
  set<pair<int, int> > st;
  for (int i = 1; i <= n; i++) st.insert({0, i});
  int now = 1;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    auto it = st.find({cnt[a[i]], a[i]});
    st.erase(it);
    cnt[a[i]]++;
    st.insert({cnt[a[i]], a[i]});
    it = st.begin();
    pair<int, int> p = *it;
    if (p.first >= now) {
      printf("1");
      now++;
    } else
      printf("0");
  }
  return 0;
}
