#include <bits/stdc++.h>
using namespace std;
int a[110], b[110], c[110];
int main(void) {
  int i;
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (i = 0; i < m; i++) {
    cin >> v[i];
  }
  for (i = 1; i <= n; i++) a[i] = -1;
  for (i = 0; i <= m - 2; i++) {
    if (a[v[i]] != -1 && a[v[i]] != (v[i + 1] - v[i] + n) % n) {
      cout << -1 << endl;
      return 0;
    }
    a[v[i]] = (v[i + 1] - v[i] + n) % n;
  }
  queue<int> q;
  for (i = 1; i <= n; i++) {
    if (a[i] != -1) {
      b[a[i]]++;
      c[a[i]] = 1;
    }
  }
  for (i = 1; i <= n; i++)
    if (c[i] == 0) q.push(i);
  bool f = true;
  for (i = 0; i < n; i++) {
    if (b[i] == 0) continue;
    if (b[i] != 1) {
      f = false;
      break;
    }
  }
  if (f) {
    for (i = 1; i <= n; i++) {
      if (a[i] == -1) {
        int x = q.front();
        q.pop();
        cout << x << ' ';
      } else {
        if (a[i] == 0) a[i] = n;
        cout << a[i] << ' ';
      }
      cout << endl;
    }
  } else {
    cout << -1 << endl;
  }
  return 0;
}
