#include <bits/stdc++.h>
const int MAXN = 5e5 + 19;
std::vector<int> to[MAXN];
int n, m, stack[MAXN], top;
struct Node {
  int id, t;
  bool operator<(const Node &b) const { return t < b.t; }
} node[MAXN];
int v[MAXN];
bool vist[MAXN];
int main() {
  std::scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    std::scanf("%d%d", &u, &v);
    to[u].emplace_back(v), to[v].emplace_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    std::scanf("%d", &node[i].t);
    node[i].id = i;
  }
  std::sort(node + 1, node + 1 + n);
  for (int i = 1; i <= n; ++i) {
    int cur = node[i].id, ttt = 0, res = 0;
    for (auto j : to[cur])
      if (v[j]) {
        if (!vist[v[j]]) ++res, vist[v[j]] = 1;
        ttt = std::max(ttt, v[j]);
      }
    for (auto j : to[cur]) vist[v[j]] = 0;
    if (ttt + 1 == node[i].t && res == ttt)
      stack[++top] = cur, v[cur] = node[i].t;
    else
      return std::puts("-1"), 0;
  }
  for (int i = 1; i <= top; ++i) std::printf("%d ", stack[i]);
  return 0;
}
