#include <bits/stdc++.h>
using namespace std;
int cnt[105], ans[105], et;
int main() {
  std::ios::sync_with_stdio(false);
  memset(cnt, 0, sizeof(cnt));
  memset(ans, -1, sizeof(ans));
  int n, m, flag = 1, now, tmp;
  cin >> n >> m;
  cin >> now;
  for (int i = 2; i <= m; i++) {
    cin >> et;
    tmp = et - now;
    if (tmp <= 0) tmp += n;
    if (ans[now] == -1) {
      ans[now] = tmp;
      cnt[tmp]++;
    } else if (ans[now] != tmp) {
      flag = 0;
    }
    now = et;
  }
  if (!flag) {
    cout << -1 << endl;
    return 0;
  } else {
    for (int i = 1; i <= n; i++) {
      if (cnt[i] >= 2) {
        flag = 0;
        break;
      }
    }
    if (!flag) {
      cout << -1 << endl;
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      if (ans[i] == -1) {
        for (int j = 1; j <= n; j++) {
          if (cnt[j] == 0) {
            ans[i] = j;
            cnt[j]++;
            break;
          }
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
