#include <bits/stdc++.h>
using namespace std;
const int limite = 200;
void morir() {
  cout << -1 << endl;
  exit(0);
}
int n, m;
int a[limite];
int visto[limite];
int l[limite];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> l[i];
  int pos = l[1];
  for (int i = 1; i < m; i++) {
    int val = (l[i + 1] - l[i] + n) % n;
    if (val == 0) val = n;
    if (visto[pos] and val != a[pos]) morir();
    visto[pos] = 1;
    a[pos] = val;
    pos = (pos - 1 + val) % n + 1;
  }
  set<int> s;
  for (int i = 1; i <= n; i++) s.insert(i);
  for (int i = 1; i <= n; i++) {
    if (visto[i]) {
      if (s.count(a[i]) == 0) morir();
      s.erase(a[i]);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (not visto[i]) {
      set<int>::iterator it = s.begin();
      a[i] = *it;
      s.erase(it);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << a[i];
  }
  cout << endl;
}
