#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  scanf(" %d %d", &n, &m);
  vector<vector<int> > adj_list(n);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf(" %d %d", &u, &v);
    --u;
    --v;
    adj_list[u].push_back(v);
    adj_list[v].push_back(u);
  }
  vector<pair<int, int> > order(n);
  for (int i = 0; i < n; ++i) {
    int o;
    scanf(" %d", &o);
    --o;
    order[i] = {o, i};
  }
  sort(order.begin(), order.end());
  vector<int> topic(n, -1), res(n, -1);
  for (int l = 0; l < n; ++l) {
    int u = order[l].second;
    int t = order[l].first;
    vector<bool> nebs(t + 1, false);
    for (int i = 0; i < (int)adj_list[u].size(); ++i) {
      int v = adj_list[u][i];
      if (topic[v] != -1 && topic[v] <= t) nebs[topic[v]] = true;
    }
    bool ok = true;
    for (int i = 0; i < t; ++i) {
      if (!nebs[i]) {
        ok = false;
        break;
      }
    }
    if (nebs[t]) ok = false;
    if (!ok) {
      printf("-1\n");
      return;
    }
    topic[u] = t;
    res[l] = u;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", res[i] + 1);
  }
  printf("\n");
}
int main() { solve(); }
