#include <bits/stdc++.h>
using namespace std;
int l[200], a[200];
bool used[200];
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 d = (l[i] - l[i - 1] + n) % n;
    if (d == 0) d = n;
    if (a[l[i - 1]] == 0 && !used[d]) {
      a[l[i - 1]] = d;
      used[d] = true;
    } else if (a[l[i - 1]] == d)
      continue;
    else {
      cout << "-1\n";
      return 0;
    }
  }
  int j = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      while (used[j]) j++;
      a[i] = j++;
    }
    cout << a[i] << " ";
  }
  return 0;
}
