#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 3;
long long n, m, a[maxn], b;
vector<int> c;
int main() {
  cin >> n >> m;
  while (m--) {
    cin >> b;
    for (int j = b; j <= n; j++) {
      if (a[j] == 0) a[j] = b;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  return 0;
}
