#include <bits/stdc++.h>
using namespace std;
int n, k, a[200010], mi, rec[200010];
stack<int> stk;
int main(int argc, char** argv) {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a[i]);
  }
  mi = 1;
  int i = 1;
  for (; i <= k; i++) {
    stk.push(a[i]);
    rec[a[i]] = 1;
    while (!stk.empty() && stk.top() == mi) {
      mi++;
      stk.pop();
    }
    if (rec[mi]) {
      printf("-1");
      return 0;
    }
  }
  while (!stk.empty()) {
    for (int j = stk.top() - 1; j >= mi; j--) {
      if (rec[j]) {
        printf("-1");
        return 0;
      }
      rec[j] = 1;
      a[i] = j;
      i++;
    }
    mi = stk.top() + 1;
    stk.pop();
  }
  for (int j = n; j >= mi; j--) {
    a[i] = j;
    i++;
  }
  for (int j = 1; j <= n; j++) {
    printf("%d ", a[j]);
  }
  return 0;
}
