#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m, tot, a[N], b[N];
void dfs(int l, int r, int ql, int qr) {
  if (ql > qr) {
    for (int i = r; i >= l; i--) b[++tot] = i;
    return;
  }
  int mid = a[ql];
  b[++tot] = mid;
  if (mid < l || mid > r) {
    puts("-1");
    exit(0);
  }
  dfs(l, mid - 1, ql + 1, min(qr, ql + mid - l));
  dfs(mid + 1, r, ql + mid - l + 1, qr);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  dfs(1, n, 1, m);
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
  return 0;
}
