#include <bits/stdc++.h>
using namespace std;
int n, m, l[111], a[111], num[111];
queue<int> vec;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &l[i]);
  }
  for (int i = 1; i < m; i++) {
    int t = l[i + 1];
    while (t <= l[i]) t += n;
    if (a[l[i]] && a[l[i]] != t - l[i]) {
      printf("-1\n");
      return 0;
    }
    if (!a[l[i]]) {
      a[l[i]] = t - l[i];
      num[a[l[i]]]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (num[i] > 1) {
      printf("-1\n");
      return 0;
    } else if (!num[i]) {
      vec.push(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      a[i] = vec.front();
      vec.pop();
    }
    printf("%d ", a[i]);
  }
  return 0;
}
