#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int n, k, a[maxn], ans[maxn], st[maxn], top, cnt, pp, b[maxn];
bool vis[maxn];
int main() {
  cin >> n >> k;
  for (int i = 0; i < k; ++i) cin >> a[i];
  int num = 1;
  for (int i = 0; i < k; ++i) {
    vis[a[i]] = 1;
    b[++top] = a[i];
    while (top && b[top] == num) top--, num++;
  }
  for (int i = 1; i < top; ++i) {
    if (b[i + 1] > b[i]) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < k; ++i) {
    cout << a[i] << " ";
  }
  b[top + 1] = num - 1;
  while (top > 0) {
    for (int i = b[top] - 1; i > b[top + 1]; i--) cout << i << " ";
    top--;
  }
  for (int i = n; i > b[top + 1]; i--) cout << i << " ";
  return 0;
}
