#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
int ans[N];
int a[N];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    for (int j = 1; j < n + 1; ++j)
      if (a[i] <= j)
        if (!ans[j]) ans[j] = a[i];
  }
  for (int i = 1; i < n + 1; ++i) cout << ans[i] << ' ';
}
