#include <bits/stdc++.h>
using namespace std;
int n, m, last, a[110], diff, x, cnt;
set<int> st;
int main() {
  memset(a, -1, sizeof(a));
  cin >> n >> m;
  cin >> last;
  for (int i = 1; i <= n; i++) st.insert(i);
  for (int i = 1; i < m; i++) {
    cin >> x;
    if (a[last] != -1) {
      diff = (x + n - last) % n;
      if (diff == 0) diff = n;
      if (a[last] != diff) {
        cout << -1 << endl;
        return 0;
      }
    } else {
      a[last] = (x + n - last) % n;
      if (a[last] == 0) a[last] = n;
      if (st.find(a[last]) == st.end()) {
        cout << -1 << endl;
        return 0;
      } else
        st.erase(a[last]);
    }
    last = x;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) {
      a[i] = *(st.begin());
      st.erase(st.begin());
    }
    cout << a[i] << " ";
  }
  return 0;
}
