#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  scanf("%lld", &n);
  scanf("%lld", &m);
  long long ar[n + 1], check[n + 1];
  fill(ar, ar + n + 1, -1);
  fill(check, check + n + 1, false);
  check[0]++;
  long long foo[n + 1];
  fill(foo, foo + n + 1, false);
  long long br[m];
  for (long long i = 0; i < m; i++) scanf("%lld", &br[i]);
  for (long long i = 0; i < m - 1; i++) {
    long long from = br[i];
    long long to = br[i + 1];
    if (to > from) {
      long long idx = abs(to - from);
      if (ar[from] != -1) {
        if (ar[from] != idx) {
          puts("-1");
          exit(0);
        } else
          continue;
      }
      if (check[idx]) {
        puts("-1");
        exit(0);
      }
      ar[from] = idx;
      check[idx]++;
    } else if (to < from) {
      long long idx = n - abs(from - to);
      if (ar[from] != -1) {
        if (ar[from] != idx) {
          puts("-1");
          exit(0);
        } else
          continue;
      }
      if (check[idx]) {
        puts("-1");
        exit(0);
      }
      ar[from] = idx;
      check[idx]++;
    } else {
      if (ar[from] != -1) {
        if (ar[from] != n) {
          puts("-1");
          exit(0);
        } else
          continue;
      }
      if (check[n]) {
        puts("-1");
        exit(0);
      }
      ar[from] = n;
      check[n]++;
    }
  }
  long long idx = 0;
  for (long long i = 1; i <= n; i++) {
    if (!check[i]) foo[idx++] = i;
  }
  idx = 0;
  for (long long i = 1; i <= n; i++) {
    if (ar[i] == -1) {
      ar[i] = foo[idx++];
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << ar[i] << " ";
  }
  cout << endl;
  return 0;
}
