#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < m; i++) cin >> a[i];
  vector<long long> ans(n + 1, 0);
  set<long long> s;
  for (long long i = 1; i <= n; i++) s.insert(i);
  for (long long i = 0; i < m - 1; i++) {
    if (a[i + 1] > a[i])
      ans[a[i]] = a[i + 1] - a[i];
    else
      ans[a[i]] = n - a[i] + a[i + 1];
    s.erase(ans[a[i]]);
  }
  for (long long i = 1; i <= n; i++) {
    if (ans[i] == 0 && s.size() > 0) {
      ans[i] = *s.begin();
      s.erase(s.begin());
    }
  }
  s.clear();
  for (long long i = 1; i <= n; i++) s.insert(ans[i]);
  if (s.size() != n) return cout << -1, 0;
  if (*s.begin() == 0) return cout << -1, 0;
  for (long long i = 0; i < m - 1; i++) {
    if (a[i + 1] > a[i]) {
      if (a[i + 1] != a[i] + ans[a[i]]) return cout << -1, 0;
    } else {
      if (a[i + 1] != (ans[a[i]] - n + a[i])) return cout << -1, 0;
    }
  }
  for (long long i = 1; i <= n; i++) cout << ans[i] << " ";
}
