#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int used[MAXN];
int l[MAXN];
int a[MAXN];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i];
  }
  for (int i = 1; i < m; i++) {
    int tmp = l[i] - l[i - 1];
    if (tmp <= 0) tmp = n + tmp;
    if ((l[i - 1] != used[tmp] && used[tmp] != 0) ||
        (a[l[i - 1]] != tmp && a[l[i - 1]] != 0)) {
      cout << "-1" << endl;
      return 0;
    }
    a[l[i - 1]] = tmp;
    used[tmp] = l[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      for (int j = 1; j < MAXN; j++)
        if (!used[j]) {
          a[i] = j;
          used[j] = i;
          break;
        }
    }
  }
  for (int i = 1; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << a[n] << endl;
  return 0;
}
