#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const int NMAX = 100;
int arr[NMAX + 5];
bool num[NMAX + 5];
int findNum() {
  for (int i = 1; i <= NMAX; i++) {
    if (num[i]) {
      num[i] = false;
      return i;
    }
  }
  return -1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(arr, -1, sizeof(arr));
  memset(num, true, sizeof(num));
  int n, m, l;
  cin >> n >> m >> l;
  while (--m) {
    int lt, ans;
    cin >> lt;
    if (lt < l)
      ans = (n - l) + lt;
    else if (lt > l)
      ans = lt - l;
    else
      ans = n;
    if ((!num[ans] || arr[l] != -1) && arr[l] != ans) {
      cout << "-1\n";
      return 0;
    } else {
      arr[l] = ans;
      num[ans] = false;
    }
    l = lt;
  }
  for (int i = 1; i < n; i++) {
    arr[i] = (arr[i] == -1 ? findNum() : arr[i]);
    assert(arr[i] != -1);
    cout << arr[i] << " ";
  }
  arr[n] = (arr[n] == -1 ? findNum() : arr[n]);
  assert(arr[n] != -1);
  cout << arr[n] << "\n";
}
