Example

Input

5 3
4
2
5


Output

5
2
4
1
3
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) begin(x),end(x)
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
	int N, M;
	cin >> N >> M;

	vector<int> e( M );
	for( auto &x : e )
	{
		cin >> x;
	}

	reverse( ALL( e ) );

	vector<int> vc, flag( N + 1, 0 );
	REP( i, M )//O(n)
	{
		if( flag[ e[ i ] ] == 0 )//O(1)
		{
			vc.emplace_back( e[ i ] );//O(1)
			flag[ e[ i ] ] = 1;
		}
	}

	//move
	for( const auto &x : vc )
	{
		cout << x << endl;
	}

	sort( ALL( vc ) );

	//not move
	REP2( i, 1, N + 1 )//O(n)
	{
		if( flag[ i ] != 0 )//O(1)
		{
			continue;
		}
		cout << i << endl;
	}

	return 0;
}