#include <bits/stdc++.h>
typedef struct node {
  int data;
  struct node* next;
} node;
node* push(node* head, int x) {
  node* temp = (node*)malloc(sizeof(node));
  temp->data = x;
  temp->next = head;
  head = temp;
  return head;
}
node* pop(node* head) {
  if (head == NULL) return head;
  node* temp = head;
  head = temp->next;
  free(temp);
  return head;
}
int a[200005], b[200005];
int main() {
  int i, j, cur, n, k, max = -1;
  scanf("%d%d", &n, &k);
  for (i = 0; i < k; i++) scanf("%d", &a[i]);
  cur = 1;
  i = 0, j = 0;
  node* head = NULL;
  while (i < k) {
    if (head == NULL) {
      head = push(head, a[i++]);
      b[j++] = head->data;
      while (head->data == cur) {
        cur++;
        head = pop(head);
        if (head == NULL) break;
      }
      continue;
    }
    if (head->data < a[i]) {
      printf("-1\n");
      return 0;
    }
    if (head->data > a[i]) {
      head = push(head, a[i++]);
      b[j++] = head->data;
      while (head->data == cur) {
        cur++;
        head = pop(head);
        if (head == NULL) break;
      }
    }
  }
  while (i < n) {
    if (head == NULL) {
      head = push(head, n);
      b[j++] = head->data;
      i++;
      continue;
    }
    head = push(head, head->data - 1);
    b[j++] = head->data;
    while (head->data == cur) {
      cur++;
      head = pop(head);
      if (head == NULL) break;
    }
    i++;
  }
  for (i = 0; i < j; i++) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
