#include <bits/stdc++.h>
using namespace std;
int a[200005], n, k;
bool used[200005];
int main() {
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    used[a[i]] = true;
  }
  bool legal = true;
  stack<int> stk;
  int wait = 1;
  for (int i = 0; i < k; i++) {
    if (a[i] == wait)
      wait++;
    else if (stk.empty())
      stk.push(a[i]);
    else if (a[i] < stk.top())
      stk.push(a[i]);
    else {
      while (!stk.empty() && stk.top() < a[i]) {
        if (stk.top() != wait) {
          legal = false;
          break;
        }
        wait++;
        stk.pop();
      }
      if (legal)
        stk.push(a[i]);
      else
        break;
    }
  }
  if (legal) {
    while (!stk.empty()) {
      if (stk.top() == wait) {
        stk.pop();
        wait++;
        continue;
      }
      int Top = stk.top();
      for (int i = Top - 1; i >= wait; i--) a[k++] = i;
      stk.pop();
      wait = Top + 1;
    }
    for (int i = n; i >= wait; i--) a[k++] = i;
    cout << a[0];
    for (int i = 1; i < k; i++) cout << ' ' << a[i];
  } else
    cout << -1;
}
