#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n, 0);
  vector<bool> vis(n + 1, false);
  int st;
  cin >> st;
  bool can = true;
  for (int i = 1; i < m; i++) {
    int p;
    cin >> p;
    int x = p - st;
    if (x <= 0) x += n;
    if (a[st - 1] == 0) {
      if (!vis[x]) {
        a[st - 1] = x;
        vis[x] = true;
      } else {
        can = false;
        break;
      }
    } else {
      if (a[st - 1] != x) {
        can = false;
        break;
      }
    }
    st = p;
  }
  if (!can) {
    cout << -1 << endl;
    return 0;
  }
  int pos = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      while (vis[pos]) {
        pos++;
      }
      a[i] = pos++;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
