#include <bits/stdc++.h>
using namespace std;
void OpenFile() {
  freopen(
      ""
      ".INP",
      "r", stdin);
  freopen(
      ""
      ".OUT",
      "w", stdout);
}
const int maxn = 2e5 + 1;
int n, k, p[maxn], End;
vector<int> st;
void Enter() {
  cin >> n >> k;
  for (int i = 1; i <= k; ++i) cin >> p[i];
}
void Init() {}
void Solve() {
  End = 0;
  for (int i = 1; i <= k; ++i) {
    if (st.size() && st.back() < p[i]) {
      cout << -1;
      return;
    }
    st.push_back(p[i]);
    while (st.size() && st.back() == End + 1) {
      st.pop_back();
      ++End;
    }
  }
  for (int i = 1; i <= k; ++i) cout << p[i] << ' ';
  while (st.size()) {
    for (int i = st.back() - 1; i > End; --i) cout << i << ' ';
    End = st.back();
    st.pop_back();
  }
  for (int i = n; i > End; --i) cout << i << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Enter();
  Init();
  Solve();
}
