27 lines
479 B
Python
27 lines
479 B
Python
n, m = map(int, input().split())
|
|
|
|
dat = [int(input()) for _ in range(m)]
|
|
|
|
sdat = set(dat)
|
|
missing = [x for x in range(1, n + 1) if x not in sdat]
|
|
|
|
res = []
|
|
i = 0
|
|
j = 0
|
|
while i < len(dat) and j < len(missing):
|
|
if dat[i] < missing[j]:
|
|
res.append(dat[i])
|
|
i += 1
|
|
else:
|
|
res.append(missing[j])
|
|
j += 1
|
|
while i < len(dat):
|
|
res.append(dat[i])
|
|
i += 1
|
|
while j < len(missing):
|
|
res.append(missing[j])
|
|
j += 1
|
|
|
|
for x in res:
|
|
print(x)
|