#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int> > adjList(n + 1);
  vector<set<int> > adjSet(n + 1);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adjList[u].push_back(v);
    adjList[v].push_back(u);
  }
  vector<int> topics(n + 1);
  vector<pair<int, int> > sortedTopics;
  for (int u = 1; u <= n; ++u) {
    scanf("%d", &topics[u]);
    sortedTopics.emplace_back(topics[u], u);
  }
  sort(sortedTopics.begin(), sortedTopics.end());
  vector<int> order;
  for (int p = 0; p < n; ++p) {
    int u = sortedTopics[p].second;
    int topic = sortedTopics[p].first;
    if (adjSet[u].size() != topic - 1 ||
        adjSet[u].lower_bound(topic) != adjSet[u].end()) {
      break;
    }
    order.push_back(u);
    for (int i = 0; i < adjList[u].size(); ++i) {
      int v = adjList[u][i];
      adjSet[v].insert(topic);
    }
  }
  if (order.size() < n)
    printf("-1\n");
  else {
    printf("%d", order[0]);
    for (int i = 1; i < n; ++i) printf(" %d", order[i]);
    printf("\n");
  }
  return 0;
}
