#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
long long power(long long x, long long y) {
  long long t = 1;
  while (y > 0) {
    if (y % 2)
      y -= 1, t = t * x % mod;
    else
      y /= 2, x = x * x % mod;
  }
  return t;
}
long long v[N];
map<long long, long long> M;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, i, j;
  cin >> n >> m;
  for (i = 1; i <= m; ++i) {
    cin >> v[i];
  }
  vector<long long> res;
  map<long long, long long>::iterator itr;
  for (i = 1; i <= m; ++i) {
    M[v[i]]++;
    if ((int)(M).size() == n) {
      vector<long long> temp;
      res.push_back(1);
      for (itr = M.begin(); itr != M.end(); itr++) {
        itr->second--;
        long long a = itr->first;
        if (itr->second == 0) {
          temp.push_back(a);
        }
      }
      for (j = 0; j < (int)(temp).size(); ++j) {
        M.erase(temp[j]);
      }
    } else {
      res.push_back(0);
    }
  }
  for (i = 0; i < (int)(res).size(); ++i) cout << res[i];
  return 0;
}
