#include <bits/stdc++.h>
using namespace std;
using INT = long long;
const int NN = 2002020;
int a[NN];
int vst[NN], f[NN];
int ok(int n) {
  stack<int> s;
  int nn = 0;
  for (int i = 1; i <= n; i++) {
    if (nn + 1 == a[i]) {
      nn++;
      while (!s.empty()) {
        if (nn + 1 == s.top()) {
          nn++;
          s.pop();
        } else
          break;
      }
      continue;
    } else
      s.push(a[i]);
  }
  return nn == n;
}
int main() {
  int mx = 0;
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) cin >> a[i], vst[a[i]] = i, mx = max(mx, a[i]);
  int nn = k;
  for (int i = k; i; i--) {
    int u = a[i];
    f[u] = 1;
    u--;
    while (!f[u] && u) {
      f[u] = 1;
      if (vst[u]) {
        u--;
        continue;
      }
      a[++nn] = u;
      vst[u] = 1;
      u--;
    }
  }
  for (int i = n; i; i--) {
    if (vst[i]) continue;
    a[++nn] = i;
    vst[i] = nn;
  }
  if (ok(n)) {
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  } else
    puts("-1");
}
