#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long MOD = 1e9 + 7;
long long n, m, a[105], l[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) cin >> l[i];
  for (long long i = 1; i < m; i++) {
    if (l[i + 1] > l[i]) {
      if (a[l[i]] != 0 && a[l[i]] != l[i + 1] - l[i]) return cout << "-1", 0;
      a[l[i]] = l[i + 1] - l[i];
    } else {
      if (a[l[i]] != 0 && a[l[i]] != n - l[i] + l[i + 1])
        return cout << "-1", 0;
      a[l[i]] = n - l[i] + l[i + 1];
    }
  }
  set<long long> st;
  for (long long i = 1; i <= n; i++) st.insert(i);
  for (long long i = 1; i <= n; i++) {
    if (a[i] == 0) continue;
    if (!st.count(a[i])) return cout << "-1", 0;
    st.erase(a[i]);
  }
  for (long long i = 1; i <= n; i++)
    if (!a[i]) a[i] = *st.begin(), st.erase(st.begin());
  for (long long i = 1; i <= n; i++) cout << a[i] << " ";
}
