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