#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n, -1), u(n, 0);
  int px;
  cin >> px;
  --px;
  for (int i = 1; i < m; ++i) {
    int x;
    cin >> x;
    --x;
    int dx = (n - 1 + x - px) % n;
    if (a[px] != -1 && a[px] != dx) {
      cout << -1 << endl;
      return;
    }
    if (a[px] == -1 && u[dx] == 1) {
      cout << -1 << endl;
      return;
    }
    a[px] = dx;
    u[dx] = 1;
    px = x;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] == -1) {
      for (int j = 0; j < n; ++j) {
        if (u[j] == 0) {
          a[i] = j;
          u[j] = 1;
          break;
        }
      }
    }
    cout << a[i] + 1 << " ";
  }
}
int main() {
  solve();
  return 0;
}
