#include <bits/stdc++.h>
using namespace std;
int n;
int k;
int want;
vector<int> v;
void done() {
  while (want == v.back()) {
    want = v.back();
    v.pop_back();
    want++;
  }
}
set<int> s;
vector<int> ans;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    s.insert(i);
  }
  want = 1;
  v.push_back(INT_MAX);
  for (int i = 0; i < k; i++) {
    int a;
    scanf("%d", &a);
    s.erase(a);
    ans.push_back(a);
    if (v.size() && v.back() < a) {
      puts("-1");
      return 0;
    }
    v.push_back(a);
    done();
  }
  while (s.size()) {
    int bh = v.back();
    auto it = s.upper_bound(bh);
    it--;
    int val = (*it);
    s.erase(it);
    v.push_back(val);
    ans.push_back(val);
    done();
  }
  v = ans;
  for (int i = 0; i < v.size(); i++) {
    if (i) printf(" ");
    printf("%d", v[i]);
  }
  puts("");
  return 0;
}
