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