#include <bits/stdc++.h>
using namespace std;
int32_t seed;
mt19937 rng(seed = chrono::steady_clock::now().time_since_epoch().count());
inline int32_t rnd(int32_t l = 0, int32_t r = INT_MAX) {
  return uniform_int_distribution<int32_t>(l, r)(rng);
}
template <typename T, typename G>
ostream &operator<<(ostream &out, const pair<T, G> &a) {
  return out << "( " << a.first << ", " << a.second << ")";
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &a) {
  out << "[ ";
  for (const auto &i : a) out << i << ", ";
  return out << "]" << endl;
}
template <typename T>
ostream &operator<<(ostream &out, const set<T> &a) {
  out << "{ ";
  for (const auto &i : a) out << i << ", ";
  return out << "}" << endl;
}
template <typename T, typename G>
ostream &operator<<(ostream &out, const map<T, G> &a) {
  out << "< ";
  for (const auto &i : a) out << i << ", ";
  return out << ">" << endl;
}
template <typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
                   ostream &>::type
operator<<(ostream &out, T (&a)[N]) {
  out << "[ ";
  for (size_t i = 0; i < N; ++i) out << a[i] << ", ";
  out << "]" << endl;
  return out;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << (H) << " ";
  debug_out(T...);
}
vector<vector<int32_t> > adjlst, ans;
vector<int32_t> col, vis;
void dfs(int32_t u) {
  vis[u] = 1;
  for (auto &v : adjlst[u]) {
    if (col[u] == col[v]) {
      cout << "-1\n";
      exit(0);
    }
    if (vis[v]) {
      continue;
    }
    dfs(v);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int32_t n, m, i;
  cin >> n >> m;
  adjlst.clear();
  adjlst.resize(n + 1);
  ans.clear();
  ans.resize(n + 1);
  col.clear();
  col.resize(n + 1);
  vis.assign(n + 1, 0);
  for (i = 0; i < m; i++) {
    int32_t u, v;
    cin >> u >> v;
    adjlst[u].push_back(v);
    adjlst[v].push_back(u);
  }
  for (i = 1; i <= n; i++) {
    cin >> col[i];
    ans[col[i]].push_back(i);
  }
  for (i = 1; i <= n; i++) {
    if (!vis[i]) dfs(i);
  }
  for (i = 2; i <= n; i++) {
    for (auto &u : ans[i]) {
      set<int32_t> cols;
      for (auto &v : adjlst[u])
        if (col[v] < col[u]) cols.insert(col[v]);
      if (cols.size() != col[u] - 1 || *cols.rbegin() != col[u] - 1) {
        cout << "-1\n";
        exit(0);
      }
    }
  }
  for (auto &id : ans)
    for (auto &i : id) cout << i << " ";
  cout << "\n";
  return 0;
}
