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