#include <bits/stdc++.h>
using namespace std;
class TaskB {
 public:
  void solve(istream& in, ostream& out) {
    int n, m;
    in >> n >> m;
    vector<int> l(m);
    for (int i = 0; i < m; ++i) {
      in >> l[i];
    }
    vector<int> a(n, -1);
    set<int> free;
    for (int i = 1; i <= n; ++i) {
      free.insert(i);
    }
    for (int i = 0; i + 1 < m; ++i) {
      int val = (l[i + 1] - l[i] + n) % n;
      if (val == 0) {
        val = n;
      }
      if (a[l[i] - 1] != -1) {
        if (a[l[i] - 1] == val) {
          continue;
        } else {
          out << "-1\n";
          return;
        }
      }
      a[l[i] - 1] = val;
      if (free.find(a[l[i] - 1]) == free.end()) {
        out << "-1\n";
        return;
      }
      free.erase(a[l[i] - 1]);
    }
    for (int i = 0; i < n; ++i) {
      if (a[i] == -1) {
        a[i] = *free.begin();
        free.erase(free.begin());
      }
      assert(a[i] >= 1 && a[i] <= n);
    }
    assert(free.empty());
    for (int i = 0; i < n; ++i) {
      out << a[i] << " ";
    }
    out << "\n";
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  TaskB solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
