#include <bits/stdc++.h>
using namespace std;
int a[105], b[105], c[105];
int main() {
  int i, j, k, n, m, x, y, z = 0, t;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    t = a[i] - a[i - 1];
    if (t > 0)
      k = a[i] - a[i - 1];
    else
      k = a[i] - a[i - 1] + n;
    if (b[a[i - 1]] == 0 || b[a[i - 1]] == k) {
      b[a[i - 1]] = k;
    } else {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    c[b[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (c[i] > 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] == 0) {
      for (int j = 1; j <= n; j++)
        if (c[j] == 0) {
          b[i] = j;
          c[j] = 1;
          break;
        }
    }
  }
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
}
