#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> edges(m);
  for (auto &edge : edges) {
    cin >> edge.first >> edge.second;
    edge.first--;
    edge.second--;
  }
  vector<pair<long long, long long>> topics(n);
  for (int i = 0; i < n; i++) {
    cin >> topics[i].first;
    topics[i].second = i + 1;
  }
  for (auto edge : edges) {
    if (topics[edge.first].first == topics[edge.second].first) {
      cout << -1 << endl;
      exit(0);
    }
  }
  vector<set<long long>> adj(n);
  for (auto edge : edges) {
    adj[edge.first].insert(topics[edge.second].first);
    adj[edge.second].insert(topics[edge.first].first);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < topics[i].first; j++) {
      if (adj[i].find(j) == adj[i].end()) {
        cout << -1 << endl;
        exit(0);
      }
    }
  }
  sort(topics.begin(), topics.end());
  for (int i = 0; i < n; i++) cout << topics[i].second << " ";
  cout << endl;
}
