#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const double pi = 3.1415926535897932384626433832795;
using namespace std;
long long x1[300000];
long long ans[300000];
long long f[300000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  long long n, m, i, kol, now;
  cin >> n >> m;
  for (i = 1; i <= m; i++) cin >> x1[i];
  long long l1 = 0;
  now = x1[1];
  for (i = 2; i <= m; i++) {
    if (now < x1[i])
      kol = x1[i] - now;
    else
      kol = n - now + x1[i];
    if (f[kol] == 1 and ans[now] != kol) {
      cout << -1 << endl;
      return 0;
    }
    if (ans[now] == 0 or ans[now] == kol)
      ans[now] = kol, f[kol] = 1;
    else {
      cout << -1 << endl;
      return 0;
    }
    now = x1[i];
  }
  l1 = 1;
  while (f[l1] == 1) l1++;
  for (i = 1; i <= n; i++)
    if (ans[i] == 0) {
      ans[i] = l1;
      l1++;
      while (f[l1] == 1) l1++;
    }
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
