#include <bits/stdc++.h>
using namespace std;
int l[105], a[105];
bool vis[105];
int n, m;
int main(int argc, char* argv[]) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) scanf("%d", &l[i]);
  bool valid = true;
  for (int i = 0; i < (m - 1); ++i) {
    int expect = 0;
    if (l[i + 1] > l[i])
      expect = l[i + 1] - l[i];
    else
      expect = n - l[i] + l[i + 1];
    if ((a[l[i]] != 0 && a[l[i]] != expect)) {
      valid = false;
      break;
    } else
      a[l[i]] = expect;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] != 0) {
      if (vis[a[i]]) {
        valid = false;
        break;
      } else
        vis[a[i]] = true;
    }
  }
  if (!valid) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 0) {
      for (int k = 1; k <= n; ++k) {
        if (!vis[k]) {
          a[i] = k;
          vis[k] = true;
          break;
        }
      }
    }
    printf("%d ", a[i]);
  }
  putchar('\n');
  return 0;
}
