#include <bits/stdc++.h>
using namespace std;
int a[1000000 + 5];
bool used[1000000 + 5];
vector<int> c;
stack<int> q;
set<int> st;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    c.push_back(a[i]);
    used[a[i]] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      vector<int> d;
      int pos = i;
      while (!used[pos]) {
        used[pos] = true;
        d.push_back(pos);
        pos++;
        if (pos > n) break;
      }
      reverse(d.begin(), d.end());
      for (auto i : d) c.push_back(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    st.insert(i);
  }
  for (auto i : c) {
    if (i >= (*st.begin())) {
      q.push(i);
      while (!q.empty() && q.top() == (*st.begin())) {
        st.erase(q.top());
        q.pop();
      }
    }
  }
  if (!q.empty()) {
    cout << -1;
    return 0;
  }
  for (auto i : c) {
    cout << i << " ";
  }
}
