#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
bool vis[maxn];
int a[maxn];
int main(void) {
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    vector<int> s;
    int nxt = 1;
    bool valid = true;
    memset(vis, false, sizeof(vis));
    for (int i = 0; i < k; ++i) {
      scanf("%d", a + i), vis[a[i]] = true;
      if (!valid) continue;
      if (!s.empty() && a[i] > s.back()) {
        valid = false;
      }
      s.push_back(a[i]);
      while (!s.empty() && nxt == s.back()) s.pop_back(), ++nxt;
    }
    if (!valid)
      printf("-1\n");
    else {
      int up = n;
      for (int i = k; i < n; ++i) {
        if (s.empty()) {
          while (vis[up]) --up;
          s.push_back(up), vis[up] = true;
          a[i] = up;
        } else {
          a[i] = s.back() - 1;
          vis[a[i]] = true;
          s.push_back(a[i]);
        }
        while (!s.empty() && nxt == s.back()) s.pop_back(), ++nxt;
      }
      for (int i = 0; i < n; ++i) {
        if (i) putchar(' ');
        printf("%d", a[i]);
      }
      puts("");
    }
  }
  return 0;
}
