#include <bits/stdc++.h>
using namespace std;
stack<int> st;
int p[200010];
bool vis[200010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) scanf("%d", &p[i]);
  int small = 1;
  for (int i = 1; i <= k; i++) {
    vis[p[i]] = true;
    st.push(p[i]);
    while (1) {
      if (st.empty()) break;
      int val = st.top();
      if (val == small) {
        st.pop();
        small++;
      } else
        break;
    }
  }
  bool flag = true;
  for (int i = k + 1; i <= n; i++) {
    if (vis[small]) {
      flag = false;
      break;
    }
    st.push(small);
    p[i] = small;
    while (1) {
      if (st.empty()) break;
      int val = st.top();
      if (val == small) {
        st.pop();
        small++;
      } else
        break;
    }
  }
  if (small != n + 1) flag = false;
  if (flag) {
    int f = k + 1;
    for (int i = k + 2; i <= n + 1; i++) {
      if (i == n + 1 || p[i] != p[i - 1] + 1) {
        reverse(p + f, p + i);
        f = i;
      }
    }
    for (int i = 1; i <= n; i++) printf("%d ", p[i]);
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
