#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int read() {
  int ret = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  for (; ch >= '0' && ch <= '9'; ch = getchar()) ret = ret * 10 + ch - '0';
  return ret;
}
int m, n;
int a[105];
int l[105];
map<int, bool> s;
int main() {
  s.clear();
  scanf("%d%d", &n, &m);
  memset(a, -1, sizeof(a));
  for (int i = 1; i <= m; i++) {
    scanf("%d", l + i);
  }
  for (int i = 1; i < m; i++) {
    if (a[l[i]] == -1) {
      a[l[i]] = (l[i + 1] - l[i] + n) % n;
      if (a[l[i]] == 0) {
        a[l[i]] = n;
      }
      if (s[a[l[i]]]) {
        puts("-1");
        return 0;
      } else {
        s[a[l[i]]] = true;
      }
    } else if (a[l[i]] != ((l[i + 1] - l[i] + n) % n == 0
                               ? n
                               : (l[i + 1] - l[i] + n) % n)) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) {
      for (int j = 1; j <= n; j++) {
        if (s[j] == false) {
          a[i] = j;
          s[j] = true;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
