#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int l[m], a[n + 1], freq[n + 1];
  memset(a, -1, sizeof(a));
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i < m; i++) {
    cin >> l[i];
  }
  for (int i = 0; i < m - 1; i++) {
    int x;
    x = l[i] < l[i + 1] ? l[i + 1] : (l[i + 1] + n);
    if (a[l[i]] == -1) {
      a[l[i]] = x - l[i];
      if (freq[a[l[i]]]) {
        cout << -1;
        return 0;
      }
      freq[a[l[i]]] = 1;
    } else if (a[l[i]] != x - l[i]) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) {
      for (int j = 1; j <= n; j++) {
        if (!freq[j]) {
          a[i] = j;
          freq[j] = 1;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
}
