#include <bits/stdc++.h>
using namespace std;
int ar[1000000 + 9];
int CNT[1000000 + 9];
vector<int> vec;
int main() {
  int i, j, k, l, n, m, ans = 0, temp, tot, sum, curr, pos, prevpos, siz, val;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> ar[i];
  }
  curr = 1;
  for (i = 1; i <= m; i++) {
    vec.push_back(ar[i]);
    while (vec.size()) {
      siz = vec.size();
      if (vec[siz - 1] == curr) {
        curr++;
        vec.pop_back();
      } else
        break;
    }
  }
  prevpos = m;
  while (curr <= n) {
    if (vec.size()) {
      siz = vec.size();
      val = vec[siz - 1];
      if (val < curr) {
        cout << -1 << endl;
        return 0;
      }
      pos = prevpos;
      for (i = val - 1; i >= curr; i--) {
        ar[++pos] = i;
        if (pos > n) {
          cout << -1 << endl;
          return 0;
        }
      }
      for (i = prevpos + 1; i <= pos; i++) {
        vec.push_back(ar[i]);
        while (vec.size()) {
          siz = vec.size();
          if (vec[siz - 1] == curr) {
            curr++;
            vec.pop_back();
          } else
            break;
        }
      }
      prevpos = pos;
    } else {
      for (i = n; i > prevpos; i--) ar[i] = curr++;
      break;
    }
  }
  if (vec.size()) {
    cout << -1 << endl;
  } else {
    for (i = 1; i <= n; i++) {
      if (ar[i] > n || ar[i] < 1) {
        cout << -1 << endl;
        return 0;
      }
      CNT[ar[i]]++;
      if (CNT[ar[i]] > 1) {
        cout << -1 << endl;
        return 0;
      }
    }
    for (i = 1; i <= n; i++) cout << ar[i] << " ";
    cout << endl;
  }
}
