#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > d(n + 1);
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    d[t].push_back(i);
  }
  int mins = INT_MAX;
  for (int i = 1; i <= n; i++) {
    mins = min(mins, int(d[i].size()));
  }
  if (mins == 0) {
    for (int i = 0; i < m; i++) cout << 0;
    cout << endl;
    return 0;
  }
  vector<int> ans;
  for (int i = 0; i < mins; i++) {
    int maxes = 0;
    for (int j = 1; j <= n; j++) maxes = max(maxes, d[j][i]);
    ans.push_back(maxes);
  }
  sort(ans.begin(), ans.end());
  int i = 0;
  for (int j = 0; j < m; j++) {
    if (j == ans[i]) {
      cout << 1;
      i++;
    } else
      cout << 0;
  }
  cout << endl;
  return 0;
}
