Unread Messages

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

There is a group of people in an internet email message group. Messages are sent to all members of the group, and no two messages are sent at the same time.

Immediately before a person sends a message, they read all their unread messages up to that point. Each sender also reads their own message the moment it is sent. Therefore, a person’s unread messages are exactly the set of messages sent after that person’s last message.

Each time a message is sent, compute the total number of unread messages over all group members.

입력

The first line of input contains two integers nn (1n1091 \le n \le 10^9) and mm (1m1,0001 \le m \le 1,000), where nn is the number of people in the group, and mm is the number of messages sent. The group members are identified by number, 11 through nn.

Each of the next mm lines contains a single integer ss (1sn1 \le s \le n), which is the sender of that message. These lines are in chronological order.

출력

Output mm lines, each with a single integer, indicating the total number of unread messages over all group members, immediately after each message is sent.