#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v, ans;
  map<int, int> mp, mp2;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  for (int i = 0; i < m - 1; i++) {
    int x = (v[i + 1] + n - v[i]) % n;
    if (x == 0) x = n;
    if (mp2[x] != 0 && mp2[x] != v[i]) return cout << -1, 0;
    if (mp[v[i]] == 0 || mp[v[i]] == x)
      mp[v[i]] = x;
    else
      return cout << -1, 0;
    mp2[x] = v[i];
  }
  int free = 1;
  for (int i = 1; i <= n; i++) {
    if (mp[i] == 0) {
      while (mp2[free] != 0) free++;
      cout << free << " ";
      free++;
    } else
      cout << mp[i] << " ";
  }
  return 0;
}
