#include <bits/stdc++.h>
using namespace std;
const long long INF64 = (long long)1e16;
const int INF = 1e9 + 500;
const int mod = (int)1e9 + 7;
void test_case() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < k; i++) cin >> arr[i];
  vector<int> st;
  int req = 1;
  for (int i = 0; i < k; i++) {
    if (st.size() && arr[i] > st.back()) {
      cout << "-1 ";
      return;
    }
    st.push_back(arr[i]);
    while (st.size() && st.back() == req) {
      req++, st.pop_back();
    }
  }
  int idx = k;
  for (int i = k; i < n && st.size(); i++) {
    int l = st.back() - 1;
    arr[idx++] = l;
    if (l == req) {
      req++;
      while (st.size() && st.back() == req) {
        req++, st.pop_back();
      }
    } else {
      st.push_back(l);
    }
  }
  for (int i = n; i >= req; i--) {
    arr[idx++] = i;
  }
  for (int i = 0; i < n; i++) {
    cout << arr[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) test_case();
}
