Example

Input

5 3
4
2
5


Output

5
2
4
1
3
#include <stdio.h>
#include <algorithm>
#include <string.h>

using namespace std;
int a[200005],b[100005];

int main()
{
    int n;
    int m;
    while(~scanf("%d%d",&n,&m))
    {
        memset(a,0,sizeof(a));
        int len=0;
        while(m--)
        {
            int x;
            scanf("%d",&x);
                b[len++]=x;
        }
        for(int i=len-1;i>=0;i--)
        {
            if(a[b[i]]==0)
            {
                printf("%d\n",b[i]);
                a[b[i]]=1;
            }
        }
        for(int i=1;i<=n;i++)
            if(a[i]==0)printf("%d\n",i);

    }

    return 0;
}