#include <bits/stdc++.h>
using namespace std;
int t[1000];
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  int b[1000], y[1000];
  for (int j = 0; j < 1000; j++) b[j] = 1e9, y[j] = 1e9;
  int x = a[0];
  for (int i = 0; i < m - 1; i++) {
    int j = (a[i + 1] - a[i] + n) % n;
    if (j == 0) j = n;
    t[j] = 1;
    if (j != b[x] && b[x] != 1e9) {
      cout << -1;
      return 0;
    }
    b[x] = j;
    x = a[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    y[i] = b[i];
  }
  sort(b, b + n + 1);
  for (int i = 0; i < n; i++) {
    if (b[i] == b[i + 1] && b[i] != 1e9) {
      cout << -1;
      return 0;
    }
  }
  int o = 1;
  for (int i = 1; i <= n; i++) {
    if (y[i] == 1e9) {
      while (t[o]) {
        o++;
      }
      t[o] = 1;
      y[i] = o;
    }
    cout << y[i] << ' ';
  }
}
