#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[101], l, t, i, z;
  set<int> us;
  memset(a, 0, sizeof(a));
  cin >> n >> m >> t;
  for (i = 1; i < m; ++i) {
    cin >> l;
    z = (l - t > 0 ? l - t : l - t + n);
    if ((a[t] && a[t] != z) || (us.count(z) && a[t] != z)) {
      cout << -1;
      return 0;
    }
    a[t] = z;
    us.insert(z);
    t = l;
  }
  l = 1;
  for (i = 1; i < n + 1; ++i) {
    z = a[i];
    if (!a[i]) {
      while (us.count(l)) {
        ++l;
      }
      z = l;
      ++l;
    }
    cout << z << ' ';
  }
  return 0;
}
