#include <bits/stdc++.h>
using namespace std;
const int N = 123;
int l[N];
int a[N];
int h[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i];
    if (i > 0) {
      int foo = (l[i] - l[i - 1] + n) % n;
      if (!foo) {
        foo = n;
      }
      if (!a[l[i - 1]]) {
        if (h[foo]) {
          puts("-1");
          return 0;
        }
        a[l[i - 1]] = foo;
        h[foo] = 1;
      }
      if (foo != a[l[i - 1]]) {
        puts("-1");
        return 0;
      }
    }
  }
  int k = 1;
  for (int i = 1; i <= n; i++) {
    if (!h[i]) {
      while (k < n && a[k]) {
        k++;
      }
      a[k++] = i;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
