#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  stack<int> s;
  s.push(INT_MAX);
  int lastInThird = 0;
  bool flag = true;
  int* arr = new int[k];
  for (int i = 0; i < k; i++) {
    int num;
    cin >> num;
    arr[i] = num;
    if (s.top() == lastInThird + 1) {
      while (s.top() == lastInThird + 1) {
        lastInThird++;
        s.pop();
      }
    }
    if (num == lastInThird + 1)
      lastInThird++;
    else if (num < s.top())
      s.push(num);
    else {
      flag = false;
      break;
    }
  }
  while (s.top() == lastInThird + 1) {
    lastInThird++;
    s.pop();
  }
  if (flag) {
    for (int i = 0; i < k; i++) cout << arr[i] << " ";
    while (s.size() != 1) {
      int x = s.top();
      s.pop();
      for (int i = x - 1; i > lastInThird; i--) {
        cout << i << " ";
      }
      lastInThird = x;
    }
    for (int i = n; i > lastInThird; i--) {
      cout << i << " ";
    }
  } else
    cout << "-1" << endl;
  return 0;
}
