#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int getint() {
  int ans(0);
  char w = getchar();
  while (w < '0' || '9' < w) w = getchar();
  while ('0' <= w && w <= '9') {
    ans = ans * 10 + w - '0';
    w = getchar();
  }
  return ans;
}
bool mark[101];
int l[101];
int a[101];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) l[i] = getint();
  for (int i = 0; i < m - 1; i++) {
    int diff;
    if (l[i] < l[i + 1])
      diff = l[i + 1] - l[i];
    else if (l[i] > l[i + 1])
      diff = (n - l[i]) + l[i + 1];
    else
      diff = n;
    if (a[l[i]] != diff && (mark[diff] || a[l[i]] != 0)) {
      cout << "-1";
      return 0;
    } else {
      a[l[i]] = diff;
      mark[diff] = true;
    }
  }
  int idx = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      while (mark[idx] == true) idx++;
      a[i] = idx++;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
