#include <bits/stdc++.h>
using namespace std;
bool bit(int n, int i) { return (n >> i) & 1; }
int ceil(int a, int b) { return ceil(((long double)a) / b); }
int faltu;
const int mod = 1e9 + 7;
const long long inf = 4e18;
const long long ninf = -inf;
const int imax = 2e9 + 100;
const int maxn = 2e5 + 100;
void NP() {
  cout << -1 << endl;
  exit(0);
}
int main() {
  time_t t1, t2;
  t1 = clock();
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  int p[n + 1], fin[n + 1];
  for (int i = 1; i <= k; i++) {
    cin >> p[i];
    fin[i] = p[i];
  }
  stack<int> st;
  bool is_present[n + 1];
  memset(is_present, 0, sizeof(is_present));
  int smallest = 1;
  for (int i = 1; i <= k; i++) {
    while (smallest <= n and is_present[smallest]) {
      if (st.top() == smallest) {
        st.pop();
        is_present[smallest] = false;
        smallest++;
      } else {
        NP();
      }
    }
    if (p[i] != smallest) {
      is_present[p[i]] = true;
      if (!st.empty()) {
        if (st.top() < p[i]) {
          NP();
        }
      }
      st.push(p[i]);
    } else {
      smallest++;
    }
  }
  for (int i = k + 1; i <= n; i++) {
    while (smallest <= n and is_present[smallest]) {
      if (st.top() == smallest) {
        st.pop();
        is_present[smallest] = false;
        smallest++;
      } else {
        NP();
      }
    }
    if (!st.empty()) {
      int val = st.top();
      st.push(val - 1);
      is_present[val - 1] = true;
      while (!st.empty() and smallest <= n and is_present[smallest]) {
        if (st.top() == smallest) {
          st.pop();
          is_present[smallest] = false;
          smallest++;
        } else {
          NP();
        }
      }
      fin[i] = val - 1;
    } else {
      st.push(n);
      fin[i] = n;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << fin[i] << ' ';
  }
  cout << endl;
  t2 = clock();
  cerr << "time taken: " << t2 - t1 << endl;
  return 0;
}
