#include <bits/stdc++.h>
using namespace std;
int n, k, b[200005], d[200005], dd[200005], res[200005], cnt = 0, p[200005];
pair<int, int> a[200005];
priority_queue<int> qu, qu1;
stack<pair<int, int> > st;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= k; ++i)
    cin >> a[i].first, a[i].second = i, b[a[i].first] = i;
  int minn = 0;
  for (int i = k; i >= 1; --i) {
    while (!st.empty() && st.top().first < a[i].first) st.pop();
    if (st.empty())
      dd[a[i].first] = k + 2;
    else
      dd[a[i].first] = st.top().second;
    st.push(a[i]);
  }
  for (int i = 1; i <= n; ++i) {
    if (minn < k + 1) {
      p[i] = max(p[i - 1], minn);
    } else
      p[i] = minn;
    if (minn < k + 1) minn = max(minn, (b[i] ? b[i] : k + 1));
  }
  for (int i = 1; i <= k; ++i) res[++cnt] = a[i].first;
  sort(a + 1, a + k + 1);
  a[k + 1].first = n;
  dd[n] = k + 2;
  for (int i = 1; i <= k + 1; ++i) {
    if (dd[a[i].first] < p[a[i].first]) {
      cout << -1;
      exit(0);
    } else {
      if (i == k + 1) res[++cnt] = n;
      for (int j = a[i].first - 1; j >= a[i - 1].first + 1; --j) res[++cnt] = j;
    }
  }
  for (int i = 1; i <= n; ++i) cout << res[i] << ' ';
}
