#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n, m;
  cin >> n >> m;
  vector<queue<int>> q(n + 1);
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    q[a[i]].push(i);
  }
  int nc = INT_MAX;
  for (int i = 1; i <= n; i++) {
    int size = q[i].size();
    nc = min(nc, size);
  }
  int ans[m];
  memset(ans, 0, sizeof(ans));
  for (int i = 0; i < nc; i++) {
    int j = -1;
    for (int i = 1; i <= n; i++) {
      j = max(j, q[i].front());
      q[i].pop();
    }
    ans[j] = 1;
  }
  for (int i = 0; i < m; i++) cout << ans[i];
}
