#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long infll = 0x3f3f3f3f3f3f3f3f;
const int MX = 100 + 7;
const int maxn = 2e6 + 7;
const double EPS = 1e-8;
const int INF = 0x3f3f3f3f;
int n, m;
int a[MX], vis[MX];
int ans[MX];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  int flag = 1;
  for (int i = 2; i <= m; i++) {
    int step = a[i] - a[i - 1];
    if (step <= 0) step += n;
    if ((ans[a[i - 1]] == 0 && vis[step]) ||
        (ans[a[i - 1]] != 0 && ans[a[i - 1]] != step)) {
      flag = 0;
      break;
    }
    vis[step] = 1;
    ans[a[i - 1]] = step;
  }
  if (!flag)
    puts("-1");
  else {
    int last = 1;
    for (int i = 1; i <= n; i++) {
      if (ans[i]) {
        cout << ans[i] << " ";
      } else {
        for (int j = last; j <= n; j++) {
          if (!vis[j]) {
            cout << j << " ";
            vis[j] = 1;
            last = j;
            break;
          }
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
