# Arup Guha
# 3/6/2021
# Solution to 2020 SER Problem: Unread Messages

line = input("").split()
n = int(line[0])
numM = int(line[1])

# Dictionary will map user to last msg.
mydict = {}

# go through each msg.
for i in range(numM):

    # Get this person.
    p = int(input(""))

    # I've seen this message.
    mydict[p] = i

    # If no one read any messages.
    tmp = n*(i+1)

    # The people in the dictionary have read some messages.
    # Sub that out.
    for x in mydict:
        tmp -= (mydict[x]+1)

    # Ta da!
    print(tmp)
