#include <bits/stdc++.h>
int main(int argc, char** argv) {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);
  std::cout << std::fixed << std::setprecision(6);
  int n, k, p, pp = -1;
  bool used[222222] = {0};
  std::cin >> n >> k;
  std::vector<int> a;
  for (int i = 0; i < k; i++) {
    std::cin >> p;
    a.push_back(p);
    pp = std::max(p, pp);
    used[p] = true;
  }
  int x = 0;
  std::stack<int> stack;
  for (int i = 0; i < k; i++) {
    if (a[i] == x + 1) {
      x = a[i];
      while (!stack.empty()) {
        if (stack.top() != x + 1) break;
        x = stack.top();
        stack.pop();
      }
    } else if (stack.empty()) {
      stack.push(a[i]);
    } else if (stack.top() < a[i]) {
      std::cout << -1 << std::endl;
      return 0;
    } else {
      stack.push(a[i]);
    }
  }
  for (; !stack.empty();) {
    for (int i = stack.top() - 1; i >= x + 1; i--) {
      a.push_back(i);
      stack.push(i);
    }
    while (!stack.empty()) {
      if (stack.top() != x + 1) break;
      x = stack.top();
      stack.pop();
    }
  }
  if (!stack.empty()) {
    std::cout << -1 << std::endl;
    return 0;
  }
  for (int i = n; i > x; i--) a.push_back(i);
  for (const auto& i : a) std::cout << i << ' ';
  std::cout << std::endl;
  return 0;
}
