#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class L, class R>
ostream& operator<<(ostream& os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.F << ":" << m.S << ")";
  return os << "}";
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int const M = 5e5 + 5;
set<long long> st[M];
int cnt[M];
int W[M];
vector<int> G[M];
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > edges;
  int a, b;
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    edges.push_back(make_pair(a, b));
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 1; i <= n; ++i) cin >> W[i];
  bool ok = true;
  for (auto it : edges) {
    if (W[it.first] == W[it.second]) ok = false;
    if (W[it.first] < W[it.second]) {
      ++cnt[it.second];
      st[it.second].insert(W[it.first]);
    } else {
      ++cnt[it.first];
      st[it.first].insert(W[it.second]);
    }
  }
  for (int i = 1; i <= n; ++i)
    if (st[i].size() != W[i] - 1) ok = false;
  if (!ok) {
    cout << -1 << "\n";
    return 0;
  }
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      Q;
  vector<int> ans;
  for (int i = 1; i <= n; ++i) {
    if (W[i] == 1) {
      ans.push_back(i);
      Q.push(make_pair(W[i], i));
    }
  }
  while (Q.size() > 0) {
    auto p = Q.top();
    Q.pop();
    for (auto it : G[p.second]) {
      if (W[it] > W[p.second]) --cnt[it];
      if (cnt[it] == 0 && W[it] == p.first + 1) {
        Q.push(make_pair(W[it], it));
        ans.push_back(it);
      }
    }
  }
  if (ans.size() == n) {
    for (auto it : ans) cout << it << ' ';
    cout << "\n";
  } else {
    cout << -1 << "\n";
  }
  return 0;
}
