#include <bits/stdc++.h>
using namespace std;
int a[101];
int d[101];
int main() {
  int n, k;
  cin >> n >> k;
  int b[k + 1];
  for (int i = 1; i <= k; i++) cin >> b[i];
  for (int i = 2; i <= k; i++) {
    if (a[b[i - 1]] != 0) {
      if (b[i] - b[i - 1] <= 0 && a[b[i - 1]] != b[i] - b[i - 1] + n ||
          b[i] - b[i - 1] > 0 && a[b[i - 1]] != b[i] - b[i - 1]) {
        cout << -1;
        return 0;
      }
    }
    if (b[i] - b[i - 1] <= 0)
      a[b[i - 1]] = b[i] - b[i - 1] + n;
    else
      a[b[i - 1]] = b[i] - b[i - 1];
  }
  int c[101];
  int t = 0;
  for (int i = 1; i <= n; i++) {
    d[a[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (d[i] == 0) c[++t] = i;
  }
  t = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) a[i] = c[++t];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i] == a[j] && i != j) {
        cout << -1;
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
