#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> arr(m);
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  unordered_map<int, int> check;
  int count = 0;
  vector<int> ans;
  for (int i = 0; i < m; i++) {
    if (check[arr[i]] == 0) {
      count++;
    }
    check[arr[i]] += 1;
    if (count == n) {
      int distinct = 0;
      for (int j = 1; j <= n; j++) {
        check[j] -= 1;
        if (check[j] != 0) distinct++;
      }
      ans.push_back(1);
      count = distinct;
    } else {
      ans.push_back(0);
    }
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i];
  }
  cout << endl;
}
