#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 100 * 1000 + 2;
int n, k;
int ar[maxn];
set<int> st;
vector<int> v, vt;
void go(int x, int &last) {
  for (set<int>::iterator it = st.lower_bound(x); it != st.begin();) {
    --it;
    if ((*it) <= last) break;
    cout << *it << ' ';
  }
  last = x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 0; i < (n); i++) st.insert(i + 1);
  int x = 1;
  for (int i = 0; i < (k); i++) {
    int c;
    cin >> c;
    v.push_back(c);
    vt.push_back(c);
    st.erase(c);
    while (v.size() && v.back() == x) {
      x++;
      v.pop_back();
    }
    if (int(v.size()) > 1 && v[int(v.size()) - 1] > v[int(v.size()) - 2]) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < (int(vt.size())); i++) cout << vt[i] << ' ';
  int last = -1;
  while (int(v.size())) {
    go(v.back(), last);
    v.pop_back();
  }
  go(n + 1, last);
  cout << endl;
  return 0;
}
