Example

Input

5 3
4
2
5


Output

5
2
4
1
3
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n,m = LI()
    e = IR(m)
    f = [0 for i in range(n+1)]
    ans = [None for i in range(n)]
    i = m-1
    while i >= 0:
        if not f[e[i]]:
            f[e[i]] = 1
        else:
            e.pop(i)
        i -= 1
    ans[:len(e)] = e[::-1]
    k = sum(f)
    for i in range(1,n+1):
        if not f[i]:
            ans[k] = i
            k += 1
    for i in ans:
        print(i)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    A()

