#include <bits/stdc++.h>
using namespace std;
int n, k, vet[303030], ptr, pr = 1, best;
stack<int> pilha;
int main() {
  scanf("%d%d", &n, &k);
  best = n;
  for (__typeof(k) i = (0) - ((0) > (k)); i != (k) - ((0) > (k));
       i += 1 - 2 * ((0) > (k)))
    scanf("%d", vet + i);
  while (ptr < n || !pilha.empty()) {
    if (!pilha.empty() && pr == pilha.top()) {
      pr++;
      pilha.pop();
      continue;
    }
    if (ptr >= k) {
      if (pilha.empty())
        vet[ptr] = best--;
      else
        vet[ptr] = pilha.top() - 1;
    }
    if (vet[ptr] == pr) {
      pr++;
      ptr++;
    } else {
      if (!pilha.empty() && pilha.top() < vet[ptr]) {
        puts("-1");
        return 0;
      }
      pilha.push(vet[ptr++]);
    }
  }
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n)))
    printf("%d%c", vet[i], " \n"[i == n - 1]);
}
