#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  stack<int> a;
  vector<int> ans;
  int cur = 1;
  set<int> s;
  for (int i = 1; i <= n; ++i) {
    s.insert(i);
  }
  auto fix = [&]() {
    while (a.size() && a.top() == cur) {
      a.pop();
      ++cur;
    }
  };
  for (int i = 0; i < k; ++i) {
    int x;
    cin >> x;
    a.push(x);
    ans.push_back(x);
    s.erase(x);
    fix();
  }
  while (true) {
    int x = a.size() ? a.top() : n + 1;
    stack<int> add;
    while (s.size() && *s.begin() < x) {
      add.push(*s.begin());
      s.erase(s.begin());
    }
    if (add.empty()) {
      break;
    }
    while (add.size()) {
      ans.push_back(add.top());
      a.push(add.top());
      fix();
      add.pop();
    }
  }
  if (cur == n + 1) {
    for (int i : ans) {
      cout << i << " ";
    }
  } else {
    cout << -1;
  }
  return 0;
}
