#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 1e2 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
int x, n, m, p;
int a[N], b[N], c[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < m; i++) {
    if (a[i] < a[i + 1])
      x = a[i + 1] - a[i];
    else
      x = n - a[i] + a[i + 1];
    if (c[x] and b[a[i]] != x) {
      cout << -1;
      return 0;
    }
    c[x] = 1;
    b[a[i]] = x;
  }
  p = 1;
  for (int i = 1; i <= n; i++) {
    if (!b[i]) {
      while (c[p]) {
        p++;
      }
      c[p] = 1;
      b[i] = p;
    }
  }
  if (p > n) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
}
