#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\n';
  err(++it, args...);
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> div;
  div.push_back(make_pair(1, n));
  vector<int> prefix(k);
  for (int i = 0; i < k; i++) cin >> prefix[i];
  int i = 0;
  while (1) {
    pair<int, int> p = div.back();
    int l, r;
    l = p.first;
    r = p.second;
    if (i == k) break;
    div.pop_back();
    if (prefix[i] < l || prefix[i] > r) return (cout << -1 << endl), 0;
    if (l == r && l == prefix[i])
      l++;
    else if (l == prefix[i])
      div.push_back(make_pair(l + 1, r));
    else if (r == prefix[i])
      div.push_back(make_pair(l, r - 1));
    else {
      div.push_back(make_pair(min(r, prefix[i] + 1), r));
      div.push_back(make_pair(l, max(l, prefix[i] - 1)));
    }
    i++;
  }
  for (auto it : prefix) cout << it << " ";
  for (int j = div.size() - 1; j >= 0; j--) {
    int l, r;
    l = div[j].first;
    r = div[j].second;
    for (int i = r; i >= l; i--) cout << i << " ";
  }
  cout << endl;
  return 0;
}
