#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000;
const int SUPERN = 5000000;
const int MD = 1e9 + 7;
long long a[MAXN], l[MAXN], n, x, y, m;
stack<long long> st;
bool vis[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) cin >> l[i];
  for (int i = 2; i <= m; ++i) {
    if (l[i] <= l[i - 1]) {
      y = n - l[i - 1] + l[i];
    } else {
      y = l[i] - l[i - 1];
    }
    if (a[l[i - 1]] > 0 && a[l[i - 1]] != y) {
      cout << -1;
      return 0;
    } else
      a[l[i - 1]] = y;
  }
  for (int i = 1; i <= n; ++i) {
    if (vis[a[i]] && a[i] != 0) {
      cout << -1;
      return 0;
    }
    vis[a[i]] = true;
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      st.push(i);
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 0) {
      a[i] = st.top();
      st.pop();
    }
  }
  for (int i = 1; i <= n; ++i) cout << a[i] << ' ';
  return 0;
}
