#include <bits/stdc++.h>
using namespace std;
struct node {
  int t, num;
  bool operator<(const node &T) const { return num > T.num; }
};
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int num[100005], n, m, t, sum = 0;
  priority_queue<node> que;
  memset(num, 0, sizeof num);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) que.push({i, 0});
  for (int i = 1; i <= m; i++) {
    cin >> t;
    num[t]++;
    node p = que.top();
    while (num[p.t] != p.num) {
      que.pop();
      que.push({p.t, num[p.t]});
      p = que.top();
    }
    if (p.num > sum) {
      sum++;
      cout << "1";
    } else
      cout << "0";
  }
  return 0;
}
