#include <bits/stdc++.h>
using namespace std;
using DO = double;
using INT = long long;
using pii = pair<int, int>;
using pi3 = pair<pii, int>;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
int power(int a, int b, int mod, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % mod)
    if (b & 1) ans = 1LL * ans * a % mod;
  return ans;
}
const int NN = 200100;
int a[NN], b[NN], vst[NN];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int mx = 0;
  for (int i = 1; i <= k; i++) {
    scanf("%d", a + i);
    mx = max(mx, a[i]);
  }
  int cnt = 0, ed = 1;
  for (int i = 1; i <= k; i++) {
    b[++cnt] = a[i];
    while (b[cnt] == ed and cnt) {
      cnt--;
      ed++;
    }
  }
  if (cnt) {
    for (int i = 1; i < cnt; i++) {
      if (b[i + 1] > b[i]) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  for (int i = 1; i <= k; i++) {
    printf("%d ", a[i]);
  }
  for (int i = 1; i <= k; i++) vst[a[i]] = 1;
  for (int i = 1; i <= n;) {
    if (vst[i]) {
      i++;
      continue;
    }
    int j = i;
    while (!vst[i] and i <= n) i++;
    for (int l = i - 1; l >= j; l--) printf("%d ", l);
  }
  cout << endl;
  return 0;
}
