Example

Input

5 3
4
2
5


Output

5
2
4
1
3
#include <bits/stdc++.h>
#define ll long long
/*#define INF 2147483647
#define mem_INF 2139062143
#define ll_INF 9223372036854775807
#define eps 1e-8
#define fuckrand() ( ( rand() << 15 ) ^ rand() )*/
using namespace std;
inline int read() {
	int x = 0,tmp = 1;char ch = getchar();
	while( ch < '0' || ch > '9' ) {if ( ch == '-' ) tmp = -1; ch = getchar();}
	while( ch >= '0' && ch <= '9'){x = x * 10 + ch - '0'; ch = getchar(); }
	return x * tmp;
}
inline ll readll() {
	ll x = 0,tmp = 1;char ch = getchar();
	while( ch < '0' || ch > '9' ) {if ( ch == '-' ) tmp = -1; ch = getchar();}
	while( ch >= '0' && ch <= '9'){x = x * 10 + ch - '0'; ch = getchar(); }
	return x * tmp;
}
int n, m;
int l[210000], r[210000], head, x, lx, lr, rx;
int main() {
	n=read(); m=read();
	head=1; l[1]=0;
	for(int i=2;i<=n;++i){
		l[i]=i-1;
		r[i-1]=i;
	}
	r[n]=0;
	for(int i=1;i<=m;++i){
		x=read();
		if( head == x ) continue;
		lx=l[x]; rx=r[x];
		r[lx]=rx; l[rx]=lx;
		l[head]=x;
		l[x]=0; r[x]=head;
		head=x; 
	} 
	int k=head;
	while(k!=0){
		printf("%d\n",k);
		k=r[k]; 
	}
	return 0;
}

/*#include"testlib.h"
#define __ inf.readSpace()
#define ___ inf.readEoln()
int main()
{
	registerValidation();
	int a = inf.readInt(1, 10, "a");
	inf.readEof();
	return 0;
}*/