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