#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int MX = 4e5 + 9;
int n, k, a[MX], b[MX], ans[MX], j = 1;
stack<int> s;
set<int> second;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) second.insert(i);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a[i]);
    b[a[i]] = 1;
    second.erase(a[i]);
  }
  j = k + 1;
  int cur = 1;
  for (int i = 1; i <= k; i++) {
    ans[i] = a[i];
    if (a[i] == cur) {
      cur++;
      while (!s.empty()) {
        if (s.top() != cur) break;
        s.pop();
        cur++;
      }
      continue;
    }
    s.push(a[i]);
  }
  if (b[cur]) {
    puts("-1");
    return 0;
  }
  set<pair<int, int> > tt;
  for (int i = 1; i <= k; i++) {
    if (ans[i] < cur) continue;
    int u = ans[i];
    tt.insert({u, a[i]});
  }
  for (auto ii : tt) {
    int u = ii.first;
    int oo = ii.second;
    while (1) {
      if (second.empty()) break;
      auto pp = second.lower_bound(u);
      pp--;
      if (pp == second.end()) break;
      u = *pp;
      if (u > oo) break;
      second.erase(pp);
      ans[j++] = u;
    }
  }
  int u = n;
  for (int i = j; i <= n; i++) {
    if (second.empty()) {
      puts("-1");
      return 0;
    }
    auto pp = second.rbegin();
    int nxt = *pp;
    second.erase(nxt);
    ans[i] = nxt;
  }
  while (!s.empty()) s.pop();
  cur = 1;
  for (int i = 1; i <= n; i++) {
    if (ans[i] == cur) {
      cur++;
      while (!s.empty()) {
        if (s.top() != cur) break;
        s.pop();
        cur++;
      }
      continue;
    }
    s.push(ans[i]);
  }
  if (!s.empty()) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
