#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  int sum = 0;
  int a[100005];
  int rec[100005] = {0};
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    int ss = a[i];
    if (rec[ss] == 0) {
      rec[ss]++;
      sum++;
      if (sum == n) {
        cout << 1;
        for (int j = 1; j <= n; j++) {
          rec[j]--;
          if (rec[j] == 0) {
            sum--;
          }
        }
      } else {
        cout << 0;
      }
    } else {
      rec[ss]++;
      cout << 0;
    }
  }
  return 0;
}
