#include <bits/stdc++.h>
using namespace std;
long long a[10000] = {0}, ans[10000];
int main() {
  long long i, n, m, p, x;
  cin >> n >> m;
  cin >> p;
  for (i = 2; i <= m; i++) {
    cin >> x;
    int k = x - p;
    if (k <= 0) k += n;
    if (ans[p]) {
      if (ans[p] != k) {
        cout << -1;
        return 0;
      }
    } else if (a[k] == 1) {
      cout << -1;
      return 0;
    }
    ans[p] = k;
    a[k] = 1;
    p = x;
  }
  vector<int> v;
  for (i = 1; i <= n; i++) {
    if (!a[i]) v.push_back(i);
  }
  for (i = 1; i <= n; i++) {
    if (!ans[i]) {
      ans[i] = v[v.size() - 1];
      v.pop_back();
    }
  }
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
