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