#include <bits/stdc++.h>
const long long mod = 1e9 + 9;
using namespace std;
const long long N = 105;
long long vis[N], l[N], who[N], n, m;
void fail() {
  cout << "-1\n";
  exit(0);
}
int32_t main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) cin >> l[i];
  long long cur = l[1];
  for (long long i = 2; i <= m; i++) {
    long long dif = (l[i] - cur);
    if (dif <= 0) dif += n;
    if (vis[dif] && vis[dif] != cur) fail();
    who[cur] = dif;
    vis[dif] = cur;
    cur = l[i];
  }
  long long cnt = 0;
  set<long long> st;
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) {
      st.insert(i);
    }
    if (!who[i]) cnt++;
  }
  auto it = st.begin();
  if (cnt > st.size()) fail();
  for (long long i = 1; i <= n; i++) {
    if (who[i])
      cout << who[i];
    else {
      cout << *it;
      it++;
    }
    cout << " ";
  }
  return 0;
}
