#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <iostream>
using namespace std;
int a[200005], b[100005];

int main()
{
	int n;
	int m;
	while (cin >> n >> m)
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		int l = 0;
		while (m--)
		{
			int x;
			scanf("%d", &x);
			b[l++] = x;
		}
		for (int i = l - 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;
}