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