#include <bits/stdc++.h>
using namespace std;
int a[150], b[150];
int n, m;
bool flag[150];
int getdis(int x, int y) {
  bool flag = 0;
  if (x > y) {
    swap(x, y);
    flag = 1;
  }
  int ans = y - x;
  if (ans <= 0) ans += n;
  if (!flag)
    return ans;
  else
    return n - ans;
}
int first, x;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%d", &first);
  for (int i = 2; i <= m; i++) {
    scanf("%d", &x);
    int tmp = getdis(first, x);
    if (a[first] != 0 && a[first] != tmp) {
      printf("-1");
      return 0;
    }
    a[first] = tmp;
    first = x;
  }
  for (int i = 1; i <= n; i++) {
    if (!flag[a[i]] || a[i] == 0)
      flag[a[i]] = 1;
    else {
      printf("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] != 0)
      printf("%d ", a[i]);
    else {
      for (int j = 1; j <= n; j++)
        if (!flag[j]) {
          printf("%d ", j);
          flag[j] = 1;
          break;
        }
    }
  }
  return 0;
}
