#include <bits/stdc++.h>
using namespace std;
constexpr long long N = 2e5 + 9;
constexpr long long M = 305;
constexpr long long INF = 1e18;
long long a[N];
long long maxi;
long long n, k;
long long vis[N];
stack<long long> s;
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> k;
  maxi = 1;
  for (long long i = 1; i <= k; i++) {
    cin >> a[i];
    s.push(a[i]);
    while (!s.empty() && s.top() == maxi) {
      s.pop();
      ++maxi;
    }
    vis[a[i]] = 1;
  }
  while (maxi <= n) {
    while (!s.empty() && s.top() == maxi) {
      s.pop();
      ++maxi;
    }
    if (s.empty()) {
      for (long long j = n; j >= maxi; j--) {
        if (vis[j]) {
          cout << -1 << endl;
          return 0;
        }
        a[++k] = j;
        vis[j] = 1;
      }
      break;
    }
    if (s.top() < maxi) {
      cout << -1 << endl;
      return 0;
    }
    if (s.top() > maxi) {
      for (long long j = s.top() - 1; j >= maxi; j--) {
        if (vis[j]) {
          cout << -1 << endl;
          return 0;
        }
        a[++k] = j;
        vis[j] = 1;
        s.push(j);
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
