#include <bits/stdc++.h>
using namespace std;
long long int n, m, a[102], pos = 1, t[102], l[102], ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(a, -1, sizeof a);
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> l[i];
  for (int i = 1; i < m; i++) {
    if (l[i] > l[i - 1])
      ans = l[i] - l[i - 1];
    else
      ans = n - (l[i - 1] - l[i]);
    if (a[l[i - 1]] != -1 && a[l[i - 1]] != ans) {
      cout << -1 << "\n";
      return 0;
    }
    a[l[i - 1]] = ans;
  }
  for (int i = 1; i <= n; i++) t[a[i]]++;
  for (int i = 1; i <= n; i++) {
    while (t[pos] != 0) pos++;
    if (a[i] == -1) a[i] = pos, pos++;
    if (t[i] > 1) {
      cout << -1 << "\n";
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << "\n";
  return 0;
}
