#include <bits/stdc++.h>
const int maxn = 1e2 + 2;
const long long mod = 1e9 + 7, inf = 1e18;
using namespace std;
int f[maxn];
int l[maxn];
int used[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << 1 << '\n';
    return 0;
  }
  for (int i = 1; i <= m; i++) cin >> l[i];
  for (int i = 1; i <= m - 1; i++) {
    int x = l[i + 1] - l[i] + (l[i + 1] <= l[i] ? n : 0);
    if (f[l[i]] and f[l[i]] != x) {
      cout << -1 << '\n';
      return 0;
    }
    if (!f[l[i]] and used[x]) {
      cout << -1 << '\n';
      return 0;
    }
    f[l[i]] = x;
    used[x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (f[i]) continue;
    for (int j = 1; j <= n; j++) {
      if (used[j]) continue;
      used[j] = 1;
      f[i] = j;
      break;
    }
  }
  for (int i = 1; i <= n; i++) cout << f[i] << " \n"[i == n];
  return 0;
}
