#include <bits/stdc++.h>
using namespace std;
int a[150], b[200], n, x, m, xp, k;
queue<int> Q;
int main() {
  cin >> n >> m >> xp;
  for (int i = 0; i <= n; i++) a[i] = -1;
  for (int i = 2; i <= m; i++) {
    cin >> x;
    if (x > xp) {
      if (a[xp] == -1) {
        a[xp] = x - xp;
        b[x - xp]++;
      } else if (a[xp] != x - xp) {
        cout << "-1";
        return 0;
      }
    } else {
      if (a[xp] == -1) {
        a[xp] = n - xp + x;
        b[n + x - xp]++;
      } else if (a[xp] != n - xp + x) {
        cout << "-1";
        return 0;
      }
    }
    xp = x;
  }
  for (int i = 1; i <= n; i++) {
    if (!b[i]) Q.push(i);
    if (a[i] == -1) k++;
  }
  if (k != Q.size()) {
    cout << "-1";
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1 && !Q.empty()) {
      cout << Q.front() << " ";
      Q.pop();
    } else
      cout << a[i] << " ";
  }
}
