#include <bits/stdc++.h>
using namespace std;
int st[202020];
int a[202020];
bool v[202020];
int n, k, i, j, l, m, o, b;
int main() {
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a[i];
    if (a[i] == b + 1) {
      b++;
    } else if (o == 0) {
      st[++o] = a[i];
    } else if (st[o] > a[i]) {
      st[++o] = a[i];
    } else {
      l = 1;
    }
    while (o && st[o] == b + 1) {
      o--;
      b++;
    }
  }
  if (l)
    cout << -1;
  else {
    st[o + 1] = 0;
    for (i = 1; i <= m; i++) {
      v[a[i]] = 1;
      cout << a[i] << " ";
    }
    for (i = o; i >= 1; i--) {
      for (j = st[i] - 1; j > st[i + 1]; j--) {
        if (!v[j]) cout << j << " ", v[j] = 1;
      }
    }
    for (i = n; i >= 1; i--) {
      if (!v[i]) {
        cout << i << " ";
        v[i] = 1;
      }
    }
  }
}
