#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 42;
int n, m;
int arr[MAXN];
bool used[MAXN];
inline void DO_CYCLE(int &last_used, vector<int> &st) {
  while (!st.empty() && last_used + 1 == st.back()) {
    st.pop_back();
    ++last_used;
  }
}
inline void check() {
  vector<int> st;
  int last = 0;
  for (int i = 0; i < n; ++i) {
    st.push_back(arr[i]);
    DO_CYCLE(last, st);
  }
  if (last != n) {
    cout << "NO\n";
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  set<int> Q;
  for (int i = 1; i <= n; ++i) {
    Q.insert(i);
  }
  vector<int> st;
  int last_used = 0;
  for (int i = 0; i < m; ++i) {
    cin >> arr[i];
    Q.erase(arr[i]);
    used[arr[i]] = 1;
    st.push_back(arr[i]);
    DO_CYCLE(last_used, st);
  }
  int ptr = m;
  while (last_used != n) {
    DO_CYCLE(last_used, st);
    if (last_used == n) break;
    if (Q.empty()) {
      cout << -1;
      return 0;
    }
    if (st.empty()) {
      auto it = Q.end();
      st.push_back(*(--it));
      Q.erase(*it);
      arr[ptr++] = st.back();
    } else {
      auto it = Q.upper_bound(st.back());
      if (it == Q.begin()) {
        cout << -1;
        return 0;
      }
      st.push_back(*(--it));
      Q.erase(*it);
      arr[ptr++] = st.back();
    }
  }
  check();
  for (int i = 0; i < n; ++i) {
    cout << arr[i] << ' ';
  }
}
