#include <bits/stdc++.h>
using namespace std;
int vis[150];
int ans[150];
int main() {
  set<int> pq, pq2;
  int n, m, l[150], c[150] = {0};
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l[i];
  }
  for (int i = 1; i < m; i++) {
    int now = l[i];
    int next = l[i + 1];
    int t;
    if (now > next)
      t = n - now + next;
    else
      t = next - now;
    t = (t == 0 ? n : t);
    if (ans[l[i]] != 0 && ans[l[i]] != t) {
      cout << -1 << endl;
      return 0;
    }
    if (pq.count(t) && !vis[l[i]]) {
      cout << -1 << endl;
      return 0;
    } else {
      pq.insert(t);
      ans[l[i]] = t;
      c[t]++;
    }
    vis[l[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!ans[i]) {
      for (int j = 1; j <= n; j++) {
        if (!c[j]) {
          ans[i] = j;
          c[j]++;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  cout << endl;
  return 0;
}
