#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void R(T &xx) {
  xx = 0;
  char ch = getchar();
  bool F = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') F = 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    xx = xx + xx + (xx << 3) + ch - 48, ch = getchar();
  if (F) xx = -xx;
}
int n, m, l[111], a[111];
bool u[111];
int main() {
  R(n), R(m);
  for (int i = 0; i < (int)(m); i++) R(l[i]);
  for (int i = 0; i < (int)(m - 1); i++)
    a[l[i]] = (l[i + 1] - l[i] + n - 1) % n + 1;
  for (int i = (1); i <= (n); i++)
    if (u[a[i]] && a[i])
      return puts("-1"), 0;
    else
      u[a[i]] = 1;
  for (int i = (1); i <= (n); i++)
    if (!a[i])
      for (int j = (1); j <= (n); j++)
        if (!u[j]) {
          u[j] = 1, a[i] = j;
          break;
        }
  for (int i = 0; i < (int)(m - 1); i++)
    if ((l[i] + a[l[i]] + n - 1) % n + 1 != l[i + 1]) return puts("-1"), 0;
  for (int i = (1); i <= (n); i++) printf("%d ", a[i]);
  return 0;
}
