#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> tree[n];
  for (long long i = 0, u, v; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  vector<long long> topics(n);
  for (long long& i : topics) cin >> i;
  vector<long long> order(n);
  iota((order).begin(), (order).end(), 1);
  sort((order).begin(), (order).end(),
       [&](long long i, long long j) { return topics[i - 1] < topics[j - 1]; });
  for (long long i : order) {
    set<long long> st;
    for (long long child : tree[i - 1]) {
      st.insert(topics[child]);
    }
    long long cur = 1;
    while (st.find(cur) != st.end()) {
      cur++;
    }
    if (cur != topics[i - 1]) {
      cout << "-1" << endl;
      return 0;
    }
  }
  for (long long i : order) cout << i << ' ';
  return 0;
}
