#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
const int inf = 0xffffff;
int a[MAX];
int book[MAX];
int main() {
  int n, m;
  int ans = 0;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (!book[a[i]]) {
      book[a[i]]++;
      cnt++;
      if (cnt == n) {
        cout << "1";
        for (int j = 1; j <= n; j++) {
          book[j]--;
          if (book[j] == 0) cnt--;
        }
      } else {
        cout << "0";
      }
    } else {
      book[a[i]]++;
      cout << "0";
    }
  }
  return 0;
}
