#include <bits/stdc++.h>
using namespace std;
inline void file() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  if (0) {
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
  }
}
inline void read(int& n) {
  char h;
  n = 0;
  for (h = getchar(); h < '0' || h > '9'; h = getchar())
    ;
  for (; h >= '0' && h <= '9'; h = getchar()) n = n * 10 + h - '0';
}
const clock_t MAXT = (100 * CLOCKS_PER_SEC) / 1000;
const int PX[8] = {0, 0, 1, -1, 1, 1, -1, -1},
          PY[8] = {-1, 1, 0, 0, -1, 1, 1, -1}, N = 210, INF = 1e9,
          MOD = 1e9 + 7;
const long long INFL = 1e18;
const long double EPS = 1e-6;
inline int rnd(int l = 0, int r = INF) {
  unsigned ans = 0;
  ans = (ans << 15) | rand();
  ans = (ans << 15) | rand();
  ans = (ans << 15) | rand();
  ans = (ans << 15) | rand();
  ans = (ans << 15) | rand();
  ans %= r - l + 1;
  ans += l;
  return ans;
}
int n, m, a[N], b[N];
set<int> s;
int main() {
  file();
  cin >> m >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) s.insert(i);
  for (int i = 1; i < n; ++i) {
    int x = (a[i + 1] - a[i] + m) % m;
    if (!x) x = m;
    if (b[a[i]] && b[a[i]] != x) {
      cout << -1;
      return 0;
    }
    s.erase(x);
    b[a[i]] = x;
  }
  for (int i = 1; i <= m; ++i)
    if (!b[i]) {
      if (s.empty()) {
        cout << -1;
        return 0;
      }
      b[i] = *s.begin();
      s.erase(s.begin());
    }
  if (!s.empty()) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= m; ++i) cout << b[i] << ' ';
}
