#include <bits/stdc++.h>
using namespace std;
int arr[200005];
int used[200005] = {0};
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
    used[arr[i]] = 1;
  }
  deque<int> stack;
  int curr = 1;
  for (int i = 0; i < k; i++) {
    stack.push_front(arr[i]);
    while (stack.size() && stack.front() == curr) {
      curr++;
      stack.pop_front();
    }
  }
  int pos = k;
  while (stack.size()) {
    bool valid = true;
    for (int i = stack.front() - 1; i >= curr; i--)
      if (used[i]) {
        valid = false;
        break;
      }
    if (!valid) break;
    for (int i = stack.front() - 1; i >= curr; i--) arr[pos++] = i;
    curr = stack.front() + 1;
    stack.pop_front();
    while (stack.size() && stack.front() == curr) {
      curr++;
      stack.pop_front();
    }
  }
  if (stack.size() == 0) {
    for (int i = n; i >= curr; i--) arr[pos++] = i;
    curr = n + 1;
  }
  if (curr == n + 1) {
    for (int i = 0; i < n; i++) {
      if (i) cout << " ";
      cout << arr[i];
    }
    cout << endl;
  } else
    cout << -1 << endl;
}
