#include <bits/stdc++.h>
using namespace std;
int A[110];
bool u[110];
int n, m;
int dist(int l, int r) {
  if (l < r) return r - l;
  return n - l + r;
}
int main() {
  scanf("%d %d", &n, &m);
  int leader;
  scanf("%d", &leader);
  for (int i = 1; i < m; i++) {
    int x;
    scanf("%d", &x);
    int d = dist(leader, x);
    if (A[leader] == 0) {
      if (u[d]) {
        printf("-1\n");
        return 0;
      }
      A[leader] = d;
      u[d] = true;
    } else if (A[leader] != d) {
      printf("-1\n");
      return 0;
    }
    leader = x;
  }
  int p = 1;
  for (int i = 1; i <= n; i++) {
    if (A[i])
      printf("%d ", A[i]);
    else {
      while (u[p]) p++;
      printf("%d ", p);
      u[p] = true;
    }
  }
  printf("\n");
  return 0;
}
