#include <bits/stdc++.h>
const int NMAX = 100;
const int MMAX = 100;
template <typename T>
void printArray(T arr[], int n) {
  for (int i = 1; i <= n; ++i) {
    std::cout << arr[i] << ' ';
  }
  std::cout << '\n';
}
void completePermutation(int permutation[], bool used[], int n);
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool used[NMAX + 1];
  int leaders[MMAX + 1];
  int permutation[NMAX + 1];
  fill(permutation, permutation + NMAX + 1, -1);
  fill(used, used + NMAX + 1, false);
  for (int i = 0; i < m; ++i) {
    cin >> leaders[i + 1];
  }
  bool wrong = false;
  int current = 1;
  while (current < m) {
    int currentLeader = leaders[current];
    int nextLeader = leaders[current + 1];
    int offset = nextLeader - currentLeader;
    if (offset <= 0) {
      offset += n;
    }
    if ((permutation[currentLeader] != -1 &&
         permutation[currentLeader] != offset) ||
        (permutation[currentLeader] == -1 && used[offset])) {
      wrong = true;
      break;
    }
    permutation[currentLeader] = offset;
    used[offset] = true;
    ++current;
  }
  if (wrong) {
    cout << "-1\n";
    return 0;
  }
  completePermutation(permutation, used, n);
  printArray(permutation, n);
  return 0;
}
void completePermutation(int permutation[], bool used[], int n) {
  int lastUsedIndex = 0;
  for (int i = 1; i <= n; ++i) {
    if (permutation[i] == -1) {
      ++lastUsedIndex;
      while (used[lastUsedIndex]) {
        ++lastUsedIndex;
      }
      permutation[i] = lastUsedIndex;
      used[lastUsedIndex] = true;
    }
  }
}
