#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n, m, a[105] = {0}, s;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> s;
    for (int j = s; j <= n; j++) {
      if (a[j] == 0) {
        a[j] = s;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
