#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using pll = pair<ll, ll>;
template <typename T>
using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T>
using que = queue<T>;
template <typename T>
using deq = deque<T>;
template <typename T>
T id(T b) {
  return b;
};
template <typename T>
void chmax(T &x, T y) {
  if (x < y) x = y;
}
template <typename T>
void chmin(T &x, T y) {
  if (x > y) x = y;
}
template <typename S, typename K>
bool contains(S &s, K k) {
  return s.find(k) != s.end();
}
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
constexpr ll TEN(int n) {
  if (n == 0)
    return 1LL;
  else
    return 10LL * TEN(n - 1);
}
const int MAX_N = 200000;
int n, k;
vi p;
bool use[MAX_N + 1];
int main() {
  fastio();
  cin >> n >> k;
  for (int i = 0; i < int(k); i++) {
    int x;
    cin >> x;
    p.push_back(x);
  }
  bool ok = true;
  stack<int> st;
  int cur = 1;
  for (int i = 0; i < int(k); i++) {
    use[p[i]] = true;
    if (!st.empty() && st.top() < p[i]) {
      ok = false;
    }
    if (st.empty() || st.top() > p[i]) {
      st.push(p[i]);
    }
    while (!st.empty() && st.top() == cur) {
      st.pop();
      cur++;
    }
  }
  if (!ok) {
    cout << -1 << endl;
    return 0;
  }
  while (!st.empty()) {
    int cur = st.top() - 1;
    while (!use[cur] && cur >= 1) {
      use[cur] = true;
      p.push_back(cur--);
    }
    st.pop();
  }
  for (int i = n; i >= 1 && !use[i]; i--) {
    p.push_back(i);
  }
  for (auto x : p) {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
