#include <bits/stdc++.h>
void turn_off(int a[], int n, int k);
int main() {
  int a[105] = {0};
  int m, n, i, k = 0, x;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &x);
    turn_off(a, n, x);
  }
  for (i = 1; i <= n; i++) {
    if (i != 1) printf(" ");
    printf("%d", a[i]);
  }
  printf("\n");
  return 0;
}
void turn_off(int a[], int n, int k) {
  int i;
  for (i = k; i <= n; i++) {
    if (a[i] == 0) a[i] = k;
  }
}
