#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1, -1);
  int x;
  vector<int> b, st;
  vector<bool> taken(n + 1, false);
  for (int i = 1; i <= k; i++) {
    cin >> x;
    a[i] = x;
    taken[i] = true;
  }
  for (int i = 1; i <= k; i++) {
    int x = a[i];
    int z = b.size();
    if (x == z + 1)
      b.push_back(x);
    else {
      if (st.size() == 0)
        st.push_back(x);
      else if (x < st.back())
        st.push_back(x);
      else {
        while (true) {
          if (st.size() == 0) {
            st.push_back(x);
            break;
          }
          int y = st.back();
          if (x < y) {
            st.push_back(x);
            break;
          } else {
            if (y == b.size() + 1) {
              b.push_back(y);
              st.pop_back();
            } else {
              cout << -1 << endl;
              return 0;
            }
          }
        }
      }
    }
  }
  vector<int> new_arr;
  while (b.size() < n) {
    if (st.size() == 0) {
      int curr_size = b.size();
      for (int i = b.size() + 1; i <= n; i++) {
        new_arr.push_back(n + curr_size + 1 - i);
        b.push_back(i);
      }
    } else {
      int y = st.back();
      for (int i = y - 1; i > b.size(); i--) {
        new_arr.push_back(i);
        st.push_back(i);
      }
      while (true) {
        if (st.size() == 0) break;
        if (st.back() == b.size() + 1) {
          b.push_back(st.back());
          st.pop_back();
        } else
          break;
      }
    }
  }
  for (int i = 1; i <= k; i++) {
    cout << a[i] << " ";
  }
  for (int i = 0; i < new_arr.size(); i++) {
    cout << new_arr[i] << " ";
  }
  cout << endl;
}
