#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int inf = 0x3c3c3c3c;
const long long infl = 0x3c3c3c3c3c3c3c3c;
const int MAX_N = 109, MAX_L = 109;
int l[MAX_L];
int ans[MAX_N];
int used[MAX_N];
int rev[MAX_N];
int main() {
  cin.tie(NULL);
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i];
  }
  for (int i = 1; i < m; i++) {
    int v = (l[i] - l[i - 1] + n) % n;
    if (v == 0) v += n;
    int idx = l[i - 1];
    if (rev[v] && rev[v] != idx) return !printf("-1");
    if (ans[idx] && ans[idx] != v) return !printf("-1");
    used[v] = true;
    rev[v] = idx;
    ans[idx] = v;
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i]) continue;
    for (int j = 1; j <= n; j++) {
      if (used[j]) continue;
      used[j] = true;
      ans[i] = j;
      break;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
