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