#include <bits/stdc++.h>
using namespace std;
int a[105];
int n, m, ans[105];
bool vis[105];
int main() {
  cin >> n >> m;
  memset(ans, -1, sizeof(ans));
  int cnt = 0;
  for (int i = 1; i <= m; i++) cin >> a[i];
  for (int i = 1; i < m; i++) {
    int x = a[i] - 1, y = a[i + 1] - 1;
    int now = (y - x + n) % n;
    if (now == 0) now = n;
    if (ans[a[i]] == -1) {
      if (ans[a[i]] == -1) {
        ans[a[i]] = now;
        if (!vis[now])
          vis[now] = true;
        else {
          puts("-1");
          return 0;
        }
      }
    } else if (ans[a[i]] != now) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 1;
    while (vis[cnt]) cnt++;
    if (ans[i] != -1)
      printf("%d%c", ans[i], i == n ? '\n' : ' ');
    else {
      printf("%d%c", cnt, i == n ? '\n' : ' ');
      vis[cnt] = true;
    }
  }
  return 0;
}
