#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int n, m;
int a[N], pos[N];
void gg() {
  puts("-1");
  exit(0);
}
stack<int> S;
int _stack[N], top = 0;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    pos[a[i]] = i;
  }
  S.push(n + 1);
  for (int i = 1; i <= m; i++) {
    if (a[i] > S.top()) gg();
    if (a[i] == S.top()) S.pop();
    if (pos[a[i] - 1] && pos[a[i] - 1] < i) continue;
    if (a[i] != 1) S.push(max(a[i] - 1, 1));
  }
  for (int i = 1; i <= m; i++) printf("%d ", a[i]);
  for (int j = m; j >= 1; j--) {
    for (int i = a[j] - 1; i >= 1; i--) {
      if (pos[i]) break;
      printf("%d ", i);
      pos[i] = 1;
    }
  }
  for (int i = n; i >= 1; i--)
    if (!pos[i]) printf("%d ", i + 1 - 1);
}
