#include <bits/stdc++.h>
using namespace std;
int main() {
  ;
  int n, m;
  cin >> n >> m;
  vector<int> v(n + 1, 0);
  int pl = -1;
  cin >> pl;
  for (int i = 1; i < m; ++i) {
    int l;
    cin >> l;
    int val;
    if (pl < l) {
      val = l - pl;
    } else if (pl == l) {
      val = n;
    } else {
      val = n - pl + l;
    }
    if (v[pl] == 0 || v[pl] == val) {
      v[pl] = val;
    } else {
      cout << -1;
      return 0;
    }
    pl = l;
  }
  vector<bool> check(n + 1, false);
  for (int i = 1; i <= n; ++i) {
    if (v[i] != 0) {
      if (check[v[i]]) {
        cout << -1;
        return 0;
      }
      check[v[i]] = true;
    }
  }
  int pos = 1;
  for (int i = 1; i <= n; ++i) {
    if (!check[i]) {
      for (pos; pos <= n; ++pos) {
        if (v[pos] == 0) {
          v[pos] = i;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    cout << v[i] << ' ';
  }
  return 0;
}
