#include <bits/stdc++.h>
using namespace std;
int n, m, prv, t, dif, a[101];
bool pre[101];
vector<int> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cin >> prv;
  for (int i = 1; i < m; ++i) {
    cin >> t;
    dif = (t > prv) ? t - prv : n - prv + t;
    if ((pre[dif] && a[prv] != dif) || (a[prv] && dif != a[prv])) {
      cout << -1 << endl;
      return 0;
    } else
      a[prv] = dif;
    pre[dif] = true;
    prv = t;
  }
  for (int i = 1; i <= n; ++i) {
    if (!pre[i]) v.push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    if (!a[i]) {
      if (v.empty()) {
        cout << -1 << endl;
        return 0;
      }
      a[i] = v.back();
      v.pop_back();
    }
  }
  for (int i = 1; i <= n; ++i) cout << a[i] << " ";
  cout << endl;
  return 0;
}
