#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 1e6 + 5;
int n, k, fe[N];
vector<int> v;
vector<int> ans;
void no() {
  puts("-1");
  exit(0);
}
void check() {
  int a = 0, d = 0;
  for (int i = 0; i < v.size(); i++) {
    if (i && v[i] > v[i - 1]) {
      no();
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  int cur = 1;
  for (int a, j, i = 0; i < k; i++) {
    scanf("%d", &a);
    if (a == cur) {
      cur++;
      while (v.size() && v.back() == cur) {
        cur++;
        v.pop_back();
      }
    } else
      v.push_back(a);
    fe[a] = 1;
    ans.push_back(a);
  }
  check();
  vector<pair<int, int>> miss;
  for (int i = 1; i <= n; i++)
    if (!fe[i]) {
      if (!miss.size())
        miss.push_back({i, i});
      else if ((miss.back()).second + 1 == i)
        miss.back().second++;
      else
        miss.push_back({i, i});
    }
  for (int i = 0; i < miss.size(); i++) {
    int s = miss[i].first, e = miss[i].second;
    for (int j = e; j >= s; j--) ans.push_back(j);
  }
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
