#include <bits/stdc++.h>
using namespace std;
int visc[500005];
vector<int> G[500005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, c, u, v;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  vector<pair<int, int> > color;
  for (int i = 1; i <= n; i++) {
    int ar;
    cin >> ar;
    visc[i] = ar;
    color.push_back({ar, i});
  }
  sort(color.begin(), color.end());
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    u = color[i].second, c = color[i].first;
    set<int> st;
    bool ok = 1;
    for (int v : G[u]) {
      if (visc[v] < c) st.insert(visc[v]);
      if (visc[v] == c) ok = 0;
    }
    if (st.size() != c - 1) ok = 0;
    if (!ok) return cout << -1 << endl, 0;
    ans.push_back(u);
  }
  for (int v : ans) cout << v << " ";
  return 0;
}
