#include <bits/stdc++.h>
int n, m;
int last_pop;
int next = 1;
int top = 0;
int stack[200005];
int done[200005] = {0};
int ipt[200005];
void push(int x) { stack[++top] = x; }
int pop() {
  if (top > 0) {
    int ans = stack[top];
    stack[top--] = 0;
    return ans;
  } else
    return -1;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &ipt[i]);
    if (ipt[i] < stack[top] || top == 0)
      push(ipt[i]);
    else {
      printf("-1");
      return 0;
    }
    done[ipt[i]] = 1;
    while (stack[top] == next) {
      next++;
      pop();
    }
  }
  while (top > 0) {
    if (next != stack[top]) {
      if (done[stack[top] - 1] == 0 && m <= n) {
        ipt[m++] = stack[top] - 1;
        done[stack[top] - 1] = 1;
        push(stack[top] - 1);
      } else {
        printf("-1");
        return 0;
      }
    } else {
      pop();
      next++;
    }
  }
  int next = n;
  for (int i = m; i < n; ++i) {
    for (int t = next; t >= 1; --t) {
      if (done[t] == 0) {
        ipt[i] = t;
        done[t] = 1;
        next = t;
        break;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    printf("%d%c", ipt[i], i == n - 1 ? '\n' : ' ');
  }
}
