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