Fill Boxes

1

2 votes
Easy
Problem

Skyler is preparing cookies which will be in high demand. A lot of job has to be done and time is very less since they are busy preparing cookies and no one is there to pack them in boxes . Your help would be highly appreciated.             

There are  N distinct type of cookies from 1 to . You will be given M cookies of N types randomly by Skyler.

Your job is to pack these cookies in boxes such that a box must only contain N distinct cookies.

After every cookie that you receive you have to output " 1 " if you were able to fill a box with N distinct cookies else output " 0 " without quotes.

Input

The first line contains two integers n and m (1 ≤ n , m ≤ 105) — the number of distinct cookies and the number of total cookies.

The second line contains m integers a1,a2,…,am (1 ≤ ai≤ n) — the cookie number which is the sign of distinction.

Output

Print a line containing m digits. The i-th digit should be 1 if you were able to pack a box with n distinct cookies else 0.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?