#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const double E = 1e-9, pi = 2 * acos(0);
template <typename T, typename U>
void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
void amax(T &x, U y) {
  if (x < y) x = y;
}
vector<int> A;
bool f(int left, int right, int from, int to) {
  if (left > right) {
    return true;
  }
  int x = A[left];
  if (x == -1) {
    for (int i = left; i <= right; i++) {
      A[i] = to - (i - left);
    }
    return true;
  }
  if (x > to or x < from) {
    return false;
  }
  int l = x - from, r = to - x;
  return f(left + 1, left + l, from, x - 1) and
         f(left + l + 1, left + l + r, x + 1, to);
}
bool solve(int testNumber) {
  int n, k;
  if (!(cin >> n >> k)) {
    return false;
  }
  A.assign(n, -1);
  for (int i = 0; i < k; i++) {
    cin >> A[i];
  }
  bool ans = f(0, n - 1, 1, n);
  if (!ans) {
    printf("-1\n");
  } else {
    for (int x : A) {
      printf("%d ", x);
    }
    printf("\n");
  }
  return true;
}
void init(const char *in = nullptr, const char *out = nullptr) {
  if (in) freopen(in, "r", stdin);
  if (out) freopen(out, "w", stdout);
  srand(unsigned((long long)new char));
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  init();
  for (int i = 1; solve(i); i++)
    ;
  return 0;
}
