#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _read(T& t);
template <typename T>
void _read(vector<T>& v);
template <typename T1, typename T2>
void _read(pair<T1, T2>& p);
template <typename T>
void _read(T& t) {
  cin >> t;
}
template <typename T>
void _read(vector<T>& v) {
  for (unsigned _i = 0; _i < v.size(); _i++) _read(v[_i]);
}
template <typename T1, typename T2>
void _read(pair<T1, T2>& p) {
  _read(p.first);
  _read(p.second);
}
void _masterread() {}
template <typename T, typename... V>
void _masterread(T& t, V&... v) {
  _read(t);
  _masterread(v...);
}
template <typename T>
void _print(T t);
template <typename T>
void _print(vector<T>& v);
template <typename T1, typename T2>
void _print(pair<T1, T2>& p);
template <typename T>
void _print(T t) {
  cout << t;
}
template <typename T>
void _print(vector<T>& v) {
  for (unsigned _i = 0; _i < v.size(); _i++)
    _print(v[_i]), cout << (_i == v.size() - 1 ? "" : " ");
}
template <typename T1, typename T2>
void _print(pair<T1, T2>& p) {
  _print(p.first);
  cout << " ";
  _print(p.second);
}
void _masterprint() { cout << '\n'; }
template <typename T, typename... V>
void _masterprint(T t, V... v) {
  _print(t);
  if (sizeof...(v)) cout << " ";
  _masterprint(v...);
}
template <typename T>
void _debug(T t);
template <typename T1, typename T2>
void _debug(pair<T1, T2> p);
template <typename T>
void _debug(vector<T> v);
template <typename T>
void _debug(T t) {
  cerr << t;
}
template <typename T1, typename T2>
void _debug(pair<T1, T2> p) {
  cerr << "{";
  _debug(p.first);
  cerr << ", ";
  _debug(p.second);
  cerr << "}";
}
template <typename T>
void _debug(vector<T> v) {
  cerr << "(";
  for (unsigned _i = 0; _i < v.size(); _i++)
    _debug(v[_i]), cerr << (_i == v.size() - 1 ? "" : ", ");
  cerr << ")";
}
void _masterdebug() { cerr << "]\n"; }
template <typename T, typename... V>
void _masterdebug(T t, V... v) {
  _debug(t);
  if (sizeof...(v)) cerr << ", ";
  _masterdebug(v...);
}
vector<vector<long long>> flip(vector<vector<long long>> adj) {
  vector<vector<long long>> nw(adj.size());
  for (long long i = 0; i < adj.size(); i++) {
    for (long long nxt : adj[i]) nw[nxt].push_back(i);
  }
  return nw;
}
struct TopoSort {
  vector<vector<long long>> adj;
  TopoSort() {}
  TopoSort(vector<vector<long long>>& _adj) {
    adj = _adj;
    res = vector<long long>(adj.size(), -1);
  }
  long long idx;
  vector<long long> res;
  void dfs(long long node) {
    if (res[node] != -1) return;
    for (auto& e : adj[node]) dfs(e);
    res[node] = idx--;
  }
  vector<long long>& run() {
    long long n = (long long)adj.size();
    idx = n - 1;
    for (long long i = 0; i < n; i++) {
      if (res[i] == -1) dfs(i);
    }
    return res;
  }
};
void cycle(long long at, vector<bool>& vis, vector<bool>& active,
           vector<vector<long long>>& adj, bool& fnd) {
  if (vis[at]) return;
  vis[at] = true;
  active[at] = true;
  for (long long nxt : adj[at]) {
    if (active[nxt]) fnd = true;
    cycle(nxt, vis, active, adj, fnd);
  }
  active[at] = false;
}
void solve() {
  long long n, m;
  _masterread(n, m);
  vector<vector<long long>> adj(n);
  vector<pair<long long, long long>> edg(m);
  _masterread(edg);
  vector<long long> vals(n);
  _masterread(vals);
  for (auto pr : edg) {
    long long a = pr.first, b = pr.second;
    a--, b--;
    if (vals[a] == vals[b]) {
      _masterprint(-1);
      return;
    }
    if (vals[a] <= vals[b])
      adj[a].push_back(b);
    else
      adj[b].push_back(a);
  }
  bool fnd = false;
  vector<bool> vis(n, false), active(n, false);
  for (long long i = 0; i < n; i++) {
    if (!vis[i]) cycle(i, vis, active, adj, fnd);
  }
  if (fnd) {
    _masterprint(-1);
    return;
  }
  TopoSort ts(adj);
  vector<long long> srt = ts.run();
  adj = flip(adj);
  vis = vector<bool>(n, false);
  vector<long long> asrt(n);
  for (long long i = 0; i < n; i++) asrt[srt[i]] = i;
  for (long long v : asrt) {
    set<long long> seen;
    long long mx = 0;
    for (long long nxt : adj[v]) {
      if (vis[nxt]) {
        seen.insert(vals[nxt]);
        mx = max(mx, vals[nxt]);
      }
    }
    long long last = 0;
    for (long long k : seen) {
      if (k != last + 1) {
        _masterprint(-1);
        return;
      }
      last = k;
    }
    vis[v] = true;
    if (vals[v] != mx + 1) {
      _masterprint(-1);
      return;
    }
  }
  for (long long v : asrt) cout << v + 1 << ' ';
  _masterprint();
}
signed main() {
  cin.sync_with_stdio(false), cin.tie(nullptr);
  solve();
}
