#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  long long int n, m, arr[101], zre[101] = {0}, cnt[101] = {0};
  scanf("%lld", &n);
  scanf("%lld", &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &arr[i]);
  }
  long long int flg = 0;
  for (int i = 1; i < m; i++) {
    if (arr[i] > arr[i - 1]) {
      if (zre[arr[i - 1]] == 0) {
        zre[arr[i - 1]] = arr[i] - arr[i - 1];
      } else {
        if (zre[arr[i - 1]] != arr[i] - arr[i - 1]) {
          flg = 1;
        }
      }
    } else {
      if (zre[arr[i - 1]] == 0) {
        zre[arr[i - 1]] = arr[i] - arr[i - 1] + n;
      } else {
        if (zre[arr[i - 1]] != arr[i] - arr[i - 1] + n) {
          flg = 1;
        }
      }
    }
  }
  long long int count = 0;
  for (int i = 1; i <= n; i++) {
    if (zre[i] == 0) {
      count++;
    } else {
      cnt[zre[i]]++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[i] > 1) {
      flg = 1;
      break;
    }
  }
  if (flg == 1) {
    printf("-1\n");
  } else {
    long long int j = 1;
    for (int i = 1; i <= n; i++) {
      if (zre[i] == 0) {
        while (cnt[j] != 0) {
          j++;
        }
        zre[i] = j;
        j++;
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%lld ", zre[i]);
    }
    printf("\n");
  }
}
