#include <bits/stdc++.h>
using namespace std;
int a[200], n, m;
int main() {
  scanf("%d%d", &n, &m);
  int i, j, x, y;
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    for (j = x; j <= n; j++)
      if (a[j] == 0) a[j] = x;
  }
  for (i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
