#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int v[N];
bool used[N];
void no() {
  cout << -1;
  exit(0);
}
stack<int> s;
bool in_s[N];
int bit[N], n;
void update(int p, int x) {
  for (; p <= n; p += p & (-p)) {
    bit[p] += x;
  }
}
int query(int p) {
  int ret = 0;
  for (; p; p -= p & (-p)) {
    ret += bit[p];
  }
  return ret;
}
int Search(int val) {
  int i, step;
  for (step = 1; step <= n; step <<= 1)
    ;
  for (i = 0; step; step >>= 1) {
    if (i + step <= n) {
      if (val >= bit[i + step]) {
        i += step, val -= bit[i];
      }
    }
  }
  return (val == 0 ? i : 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    update(i, 1);
  }
  for (int i = 1; i <= k; i++) {
    cin >> v[i];
    used[v[i]] = 1;
    update(v[i], -1);
  }
  int c = 1;
  for (int i = 1; i <= n; i++) {
    if (in_s[i] == true) {
      if (s.empty() == false && s.top() == i) {
        s.pop();
      } else {
        no();
      }
    } else {
      while (c <= n && v[c] != i) {
        if (v[c] == 0) {
          int lf = 1;
          int rg, sol, md;
          int x;
          if (s.empty() == true) {
            sol = n;
          } else {
            rg = s.top();
            sol = rg;
            x = query(rg);
            sol = Search(x - 1) + 1;
          }
          v[c] = sol;
          update(sol, -1);
        } else {
          if (s.empty() == false && s.top() < v[c]) {
            no();
          }
        }
        if (v[c] == i) {
          break;
        }
        s.push(v[c]);
        in_s[v[c]] = true;
        c++;
      }
      if (v[c] != i) {
        no();
      }
      c++;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << v[i] << ' ';
  }
  return 0;
}
