#include <bits/stdc++.h>
using namespace std;
#define N 200005
int a[N],flag[N];
int n,m;
int main()
{
    cin>>n>>m;
    for (int i=1;i<=m;++i) scanf("%d",&a[i]);
    for (int i=m;i;--i)
    {
        if (flag[a[i]]) continue;
        flag[a[i]]=1;
        printf("%d\n",a[i]);
    }
    for (int i=1;i<=n;++i) if (!flag[i]) printf("%d\n",i);
}