#include <bits/stdc++.h>
using namespace std;
int a[110], b[110];
int main() {
  int n, m, i, j;
  cin >> n >> m;
  for (i = 1; i <= m; i++) cin >> a[i];
  for (i = 1; i <= m; i++)
    for (j = a[i]; b[j] == 0; j++) b[j] = a[i];
  for (i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
