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