#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 100;
int n, k;
bool v[MAXN];
int a[MAXN];
int main() {
  scanf(" %d %d", &n, &k);
  int d = 0;
  stack<int> s;
  for (int i = 0; i < k; i++) {
    int c;
    scanf(" %d", &c);
    a[i] = c;
    if (!s.empty() && s.top() < c) {
      printf("-1\n");
      return 0;
    }
    s.push(c);
    while (!s.empty() && s.top() == d + 1) {
      d++;
      s.pop();
    }
  }
  while (!s.empty()) {
    int to = s.top();
    s.pop();
    for (int i = to - 1; i > d; i--) a[k++] = i;
    d = to;
  }
  for (int i = n; i > d; i--) a[k++] = i;
  for (int i = 0; i < n; i++) printf("%d ", a[i]);
  return 0;
}
