#include <bits/stdc++.h>
using namespace std;
int n, m, tmp, sz;
int l[105], a[105];
bool u[105], found;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) l[i] = read();
  tmp = l[1];
  for (int i = 2; i <= m; i++)
    if (!a[tmp]) {
      a[tmp] = (l[i] - tmp + n - 1) % n + 1;
      if (u[a[tmp]]) {
        found = true;
        break;
      } else
        u[a[tmp]] = true;
      tmp = l[i];
    } else {
      if ((tmp + a[tmp] - 1) % n + 1 != l[i]) {
        found = true;
        break;
      }
      tmp = l[i];
    }
  if (found)
    puts("-1");
  else {
    sz = 1;
    for (int i = 1; i <= n; i++) {
      if (!a[i]) {
        while (u[sz]) sz++;
        a[i] = sz;
        u[a[i]] = true;
      }
      printf("%d ", a[i]);
    }
  }
  return 0;
}
