#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> p(m);
  for (long long i = 0; i < m; i++) cin >> p[i];
  vector<long long> a(n, -1);
  for (long long i = 1; i < m; i++) {
    long long kek = (p[i] > p[i - 1] ? p[i] - p[i - 1] : n - (p[i - 1] - p[i]));
    if (a[p[i - 1] - 1] != -1 && a[p[i - 1] - 1] != kek) {
      cout << "-1" << endl;
      return 0;
    }
    a[p[i - 1] - 1] = kek;
  }
  set<long long> q;
  for (long long i = 0; i < n; i++)
    if (a[i] != -1) {
      if (q.find(a[i]) != q.end()) {
        cout << "-1" << endl;
        return 0;
      }
      q.insert(a[i]);
    }
  for (long long i = 0; i < n; i++) {
    if (a[i] == -1) {
      for (long long j = 1; j <= n; j++) {
        if (q.find(j) == q.end()) {
          q.insert(j);
          a[i] = j;
          break;
        }
      }
    }
  }
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
}
