#include <bits/stdc++.h>
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int arr[m];
  map<long long int, long long int> mp;
  set<long long int> st;
  string s = "";
  for (long long int i = 0; i < m; i++) {
    cin >> arr[i];
    st.insert(arr[i]);
    mp[arr[i]]++;
    if (st.size() == n) {
      cout << 1;
      for (long long int j = 1; j <= n; j++) {
        mp[j]--;
        if (mp[j] == 0) {
          auto z = st.find(j);
          st.erase(z);
        }
      }
    } else {
      cout << 0;
    }
  }
  return 0;
}
