#include <bits/stdc++.h>
using namespace std;
int abk(int a) { return a < 0 ? -1 * a : a; }
int n, m, b[111];
int main() {
  cin >> n >> m;
  for (int v, i = 0; i < m; i++) {
    cin >> v;
    for (int j = v; j <= n; j++)
      if (!b[j]) b[j] = v;
  }
  for (int i = 1; i <= n; i++) {
    cout << b[i] << endl;
  }
}
