#include<stdio.h>

int main(void){
	int i, n, m;
	int marray[100000] = {};
	int narray[200000] = {};
	scanf("%d%d", &n, &m);
	for(i = 0; i < m; i++){
		scanf("%d", &marray[i]);
	}
	for(i = 0; i < m; i++){
		printf("%d\n", marray[m-1-i]);
		narray[marray[i]-1] = 1;
	}
	for(i = 0; i < n; i++){
		if(narray[i] == 0){
			printf("%d\n", i+1);
		}
	}
	return 0;
}