#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k;
  cin >> n >> k;
  long long p[k + 1];
  for (long long i = 1; i <= k; ++i) {
    cin >> p[i];
  }
  stack<long long> s;
  vector<long long> ans;
  ans.push_back(0);
  for (long long i = 1; i <= k; ++i) {
    if (!s.empty()) {
      while (s.top() == ans.back() + 1) {
        long long kk = s.top();
        s.pop();
        ans.push_back(kk);
        if (s.empty()) {
          break;
        }
      }
    }
    if (p[i] == ans.back() + 1) {
      ans.push_back(p[i]);
    } else {
      s.push(p[i]);
    }
  }
  if (!s.empty()) {
    while (s.top() == ans.back() + 1) {
      long long kk = s.top();
      s.pop();
      ans.push_back(kk);
      if (s.empty()) {
        break;
      }
    }
  }
  long long cnt = 0;
  vector<long long> v;
  long long sz = ans.size();
  while (cnt + sz - 1 < n) {
    if (s.empty()) {
      long long tt = ans.back() + 1;
      for (long long i = ans.back() + 1; i <= n; ++i) {
        ans.push_back(i);
        cnt++;
      }
      for (long long i = n; i >= tt; --i) {
        v.push_back(i);
      }
      break;
    }
    if (s.top() == ans.back() + 1) {
      ans.push_back(s.top());
      s.pop();
      cnt++;
    } else {
      if (s.top() < ans.back() + 1) {
        cout << -1;
        return 0;
      } else {
        long long tt = ans.back() + 1;
        for (long long i = s.top() - 1; i >= tt; --i) {
          v.push_back(i);
        }
        for (long long i = tt; i < s.top() && cnt + sz - 1 < n; ++i) {
          cnt++;
          ans.push_back(i);
        }
      }
    }
  }
  if (!s.empty())
    cout << -1;
  else {
    long long x = 1;
    ans.erase(ans.begin());
    for (auto i : ans) {
      if (x != i) {
        cout << -1;
        return 0;
      }
      x++;
    }
    for (long long i = 1; i <= k; i++) cout << p[i] << " ";
    for (auto i : v) cout << i << " ";
  }
}
