#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b, i, lights[100] = {0}, last = 1;
  cin >> n >> m;
  for (i = 0; i < m && cin >> b; i++) lights[b] = i + 1;
  for (i = 1; i <= n; i++) {
    if (lights[last] > lights[i] && lights[i] != 0) last = i;
    cout << last << " ";
  }
  return 0;
}
