#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
int XX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int YY[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int t, i, j, g, L, x, y, h, w, q, f1, f2, f3, f4, x1, x2, y1, y2, m,
      k, n, u, v, l, r, a, b;
  cin >> n >> m;
  long long int arr[m];
  for (i = 0; i < m; i++) {
    cin >> arr[i];
  }
  set<long long int> s2;
  for (i = 1; i <= n; i++) s2.insert(i);
  long long int arr2[n + 1];
  for (i = 1; i <= n; i++) arr2[i] = -1;
  set<int> s;
  for (i = 0; i < m - 1; i++) {
    long long int ind1 = arr[i];
    long long int ind2 = arr[i + 1];
    if (ind2 >= ind1) {
      long long int diff = ind2 - ind1;
      if (diff == 0) diff = n;
      if (arr2[ind1] != diff && s.find(diff) != s.end()) {
        cout << "-1";
        return 0;
      }
      s.insert(diff);
      if (arr2[ind1] != -1 && arr2[ind1] != diff) {
        cout << "-1";
        return 0;
      }
      arr2[ind1] = diff;
      s2.erase(diff);
    } else {
      long long int diff = n - ind1 + ind2;
      if (arr2[ind1] != diff && s.find(diff) != s.end()) {
        cout << "-1";
        return 0;
      }
      if (arr2[ind1] != -1 && arr2[ind1] != diff) {
        cout << "-1";
        return 0;
      }
      s.insert(diff);
      arr2[ind1] = diff;
      s2.erase(diff);
    }
  }
  for (i = 1; i <= n; i++) {
    if (arr2[i] == -1) {
      arr2[i] = *(s2.begin());
      s2.erase(arr2[i]);
    }
    cout << arr2[i] << " ";
  }
}
