#include <bits/stdc++.h>
using namespace std;
const int MAX = 110;
int a[MAX], b[MAX], vis[MAX];
bool solve(int n, int m) {
  memset(vis, 0, sizeof(vis));
  memset(b, 0, sizeof(b));
  for (int i = 1; i < m; i++) {
    int y = a[i], x = a[i - 1], w;
    if (y > x) {
      w = y - x;
    } else {
      w = y + n - x;
    }
    if (vis[w] && b[x] != w) {
      return false;
    }
    if (b[x] != 0 && b[x] != w) {
      return false;
    }
    vis[w] = 1;
    b[x] = w;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &a[i]);
    }
    bool res = solve(n, m);
    if (!res) {
      printf("-1\n");
    } else {
      for (int i = 1; i < n; i++) {
        if (b[i] != 0) {
          printf("%d ", b[i]);
        } else {
          int j;
          for (j = 1; j <= n; j++)
            if (!vis[j]) {
              printf("%d ", j);
              vis[j] = 1;
              break;
            }
        }
      }
      if (b[n] != 0) {
        printf("%d\n", b[n]);
      } else {
        int j;
        for (j = 1; j <= n; j++)
          if (!vis[j]) {
            printf("%d\n", j);
            vis[j] = 1;
            break;
          }
      }
    }
  }
  return 0;
}
