#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn];
int ans[maxn];
int num[maxn];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    memset((ans), (-1), sizeof(ans));
    memset((num), (0), sizeof(num));
    memset((a), (0), sizeof(a));
    scanf("%d", &a[0]);
    int flag = 0;
    for (int i = 1; i < m; i++) {
      scanf("%d", &a[i]);
      int temp = a[i] - a[i - 1];
      if (temp <= 0) temp += n;
      if (ans[a[i - 1]] == -1 || ans[a[i - 1]] == temp) {
        ans[a[i - 1]] = temp;
      } else {
        flag = 1;
      }
    }
    if (flag == 1) {
      puts("-1");
      continue;
    }
    for (int i = 1; i <= n; i++) {
      if (ans[i] != -1) num[ans[i]]++;
    }
    for (int i = 1; i <= n; i++) {
      if (num[i] > 1) {
        flag = 1;
        break;
      }
      if (num[i] == 0 && flag != 1) {
        flag = 2;
      }
    }
    if (flag == 1) {
      puts("-1");
      continue;
    }
    if (flag == 2) {
      for (int i = 1; i <= n; i++) {
        if (ans[i] == -1) {
          for (int j = 1; j <= n; j++) {
            if (num[j] == 0) {
              ans[i] = j;
              num[j] = 1;
              break;
            }
          }
        }
      }
    }
    for (int i = 1; i < n; i++) {
      printf("%d ", ans[i]);
    }
    printf("%d\n", ans[n]);
  }
  return 0;
}
