#include <bits/stdc++.h>
using namespace std;
int main() {
  bool f[110] = {0}, x[110] = {0};
  int n, m, a[110] = {0}, l[110];
  cin >> n >> m;
  bool b = 0;
  for (int i = 0; i < m; i++) {
    cin >> l[i];
  }
  for (int i = 0; i < m - 1; i++) {
    if (f[l[i]] == 0) {
      if (l[i + 1] > l[i]) {
        if (x[l[i + 1] - l[i]] == 1) b = 1;
        a[l[i]] = l[i + 1] - l[i];
        f[l[i]] = 1;
        x[l[i + 1] - l[i]] = 1;
      } else {
        if (x[l[i + 1] + n - l[i]] == 1) b = 1;
        a[l[i]] = l[i + 1] + n - l[i];
        f[l[i]] = 1;
        x[l[i + 1] + n - l[i]] = 1;
      }
    } else {
      if (l[i + 1] > l[i]) {
        if (a[l[i]] != l[i + 1] - l[i]) b = 1;
      } else {
        if (a[l[i]] != l[i + 1] + n - l[i]) b = 1;
      }
    }
  }
  if (b == 1)
    cout << -1;
  else {
    int p = 1;
    for (int i = 1; i <= n; i++) {
      if (f[i] == 1)
        cout << a[i] << " ";
      else {
        while (x[p] == 1) p++;
        cout << p << " ";
        p++;
      }
    }
  }
  return 0;
}
