#include <bits/stdc++.h>
using namespace std;
int n, m, kol, x, pred, k = 0;
int a[110], chis[110];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  m--;
  cin >> pred;
  while (m--) {
    cin >> x;
    if (x <= pred)
      kol = n + x - pred;
    else
      kol = x - pred;
    if (a[pred] == kol) {
    } else if (a[pred] == 0 && chis[kol] == 0) {
      chis[kol] = 1;
      a[pred] = kol;
    } else {
      cout << -1;
      return 0;
    }
    pred = x;
  }
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) {
      for (int j = k + 1; j <= n; j++)
        if (chis[j] == 0) {
          a[i] = j;
          k = j;
          break;
        }
    }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
