#include <bits/stdc++.h>
int main() {
  int n, m;
  int b[200];
  int t[200];
  int tmp;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) t[i] = 1;
  for (int i = 0; i < m; ++i) {
    scanf("%d", &tmp);
    for (int j = tmp; j <= n; ++j) {
      if (t[j] == 1) {
        b[j] = tmp;
        t[j] = 0;
      }
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", b[i]);
}
