#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std;
int a[200005],v[200005];
int main()
{
	int n,m,i;
	scanf("%d%d",&n,&m);
	for (i=1;i<=m;i++) scanf("%d",&a[i]),v[a[i]]=1;
	for (i=m;i>=1;i--) if (v[a[i]]==1) printf("%d\n",a[i]),v[a[i]]=2;
	for (i=1;i<=n;i++) if (v[i]==0) printf("%d\n",i);
	return 0;
}