#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') x = x * 10 + (ch ^ 48), ch = getchar();
  return x * f;
}
stack<long long> st;
long long a[200005], mn = 1e17, cnt, x, in[200005], tmp = 1, n, m, s[200005],
                     vis[200005];
signed main() {
  n = read(), m = read();
  a[0] = n + 1, vis[n + 1] = 1;
  for (long long i = 1; i <= m; i++) {
    in[i] = x = read();
    vis[x]++;
    a[++cnt] = x;
    while (cnt && a[cnt] == tmp) cnt--, tmp++;
  }
  for (long long i = 1; i <= cnt; i++) {
    if (a[i] < a[i - 1])
      continue;
    else {
      printf("-1");
      return 0;
    }
  }
  for (long long i = 1; i <= m; i++) printf("%lld ", in[i]);
  long long beg = 1;
  while (beg <= n) {
    for (; beg <= a[cnt]; beg++) {
      if (!vis[beg]) st.push(beg);
    }
    cnt--;
    while (st.size()) {
      printf("%lld ", st.top());
      st.pop();
    }
  }
}
