#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int>> edges(n + 1);
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  vector<int> topic(n + 1);
  vector<pair<int, int>> order;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &topic[i]);
    order.emplace_back(topic[i], i);
  }
  sort(order.begin(), order.end());
  vector<bool> vis(n + 1);
  for (pair<int, int> p : order) {
    int a = p.second;
    set<int> forbidden;
    for (int b : edges[a]) {
      if (vis[b]) {
        forbidden.insert(topic[b]);
      }
    }
    int got = 1;
    while (forbidden.count(got)) {
      got++;
    }
    if (got != topic[a]) {
      puts("-1");
      return 0;
    }
    vis[a] = true;
  }
  for (pair<int, int> p : order) {
    printf("%d ", p.second);
  }
  puts("");
}
