#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 10000 + 10;
int n, m;
int second[200], a[200];
bool vis[200];
int main() {
  scanf(" %d %d", &n, &m);
  for (int i = 0; i < m; i++) scanf(" %d", &second[i]);
  for (int i = 0; i < m; i++) second[i]--;
  bool win = true;
  for (int i = 0; i < m - 1; i++) {
    int next = second[i + 1];
    if (next <= second[i]) next += n;
    if (a[second[i]] == 0 ||
        a[second[i]] != 0 && a[second[i]] == next - second[i])
      a[second[i]] = next - second[i];
    else
      win = false;
  }
  for (int i = 0; i < n; i++) {
    if (vis[a[i]] && a[i] != 0) win = false;
    vis[a[i]] = true;
  }
  if (win) {
    int ind = 1;
    for (int i = 0; i < n; i++) {
      if (a[i] == 0) {
        while (vis[ind]) ind++;
        a[i] = ind;
        vis[ind] = true;
      }
    }
    for (int i = 0; i < n; i++) {
      if (i > 0) printf(" ");
      printf("%d", a[i]);
    }
    printf("\n");
  } else
    printf("-1\n");
  return 0;
}
