#include <bits/stdc++.h>
using namespace std;
int n, k, o, a[169], pres, Free[169];
int main() {
  scanf("%d%d", &n, &k);
  memset(a, -1, sizeof(a));
  scanf("%d", &pres);
  memset(Free, 1, sizeof(Free));
  for (int i = 2; i <= k; i++) {
    scanf("%d", &o);
    if (o > pres) {
      if (a[pres] == -1) {
        if (Free[o - pres]) {
          Free[o - pres] = 0;
          a[pres] = o - pres;
        } else {
          cout << -1;
          return 0;
        }
      } else if (a[pres] != o - pres) {
        cout << -1;
        return 0;
      }
      pres = o;
    } else {
      if (a[pres] == -1) {
        if (Free[o - pres + n]) {
          Free[o - pres + n] = 0;
          a[pres] = o - pres + n;
        } else {
          cout << -1;
          return 0;
        }
      } else if (a[pres] != o - pres + n) {
        cout << -1;
        return 0;
      }
      pres = o;
    }
  }
  int c = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) {
      while (Free[c] == 0) {
        c++;
      }
      Free[c] = 0;
      a[i] = c;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
