#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0);
const double eps = 1e-9;
int arr[100000];
int pos[100000];
int mark[100000];
int main() {
  memset(arr, 0, sizeof(arr));
  memset(pos, 0, sizeof(pos));
  memset(mark, 0, sizeof(mark));
  int n, m;
  cin >> n >> m;
  int i;
  for (i = 1; i <= m; i++) {
    cin >> pos[i];
  }
  int diff;
  int curr;
  int count1 = 0;
  for (i = 1; i < m; i++) {
    curr = pos[i];
    diff = pos[i + 1] - pos[i];
    if (diff <= 0) {
      diff += n;
    }
    if (arr[curr] != 0 && arr[curr] != diff) {
      cout << "-1\n";
      return 0;
    }
    if (mark[diff] == 0) {
      arr[curr] = diff;
      mark[diff] = curr;
      count1++;
    } else if (mark[diff] == curr) {
      continue;
    } else {
      cout << "-1\n";
      return 0;
    }
  }
  int j;
  if (count1 < n) {
    for (i = 1; i <= n; i++) {
      if (arr[i] == 0) {
        for (j = 1; j <= n; j++) {
          if (mark[j] == 0) {
            mark[j] = i;
            arr[i] = j;
            break;
          }
        }
      }
    }
  }
  for (i = 1; i <= n; i++) {
    cout << arr[i] << " ";
  }
  cout << "\n";
  return 0;
}
