#include <bits/stdc++.h>
using namespace std;
long long int n, m, cnt = 0, k, cntt = 0, cnts = 0;
long long int v[100001];
bool vis[100001], ans[100001];
long long int cnte[100001];
int main() {
  cin >> n >> m;
  memset(vis, false, sizeof(vis));
  memset(cnte, 0, sizeof(cnte));
  for (int i = 1; i <= m; i++) {
    cin >> v[i];
    cnte[v[i]]++;
    if (vis[v[i]] == false) {
      vis[v[i]] = true;
      cnt++;
    }
    if (cnt == n) {
      ans[i] = 1;
      for (int j = 1; j <= n; j++) {
        if (cnte[j] > 1) {
          cnte[j]--;
        } else {
          cnt--;
          cnte[j]--;
          vis[j] = false;
        }
      }
    } else {
      ans[i] = 0;
    }
  }
  for (int i = 1; i <= m; i++) {
    cout << ans[i];
  }
}
