Example

Input

5 3
4
2
5


Output

5
2
4
1
3
#include <bits/stdc++.h>
using namespace std;

#define N 1000002
#define pb push_back
int hit[N], a[N];
int main(){
    int n, m;
    cin >> n >> m;
    for (int i=1; i<=m; i++){
        scanf("%d", &a[i]);
    }
    for (int i=m; i>=1; i--){
        int x = a[i];
        if (hit[x] == 0) printf("%d\n", x);
        hit[x] = 1;
    }
    for (int i=1; i<=n; i++){
        if (hit[i] == 0) printf("%d\n", i);
    }
    return 0;
}