#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 10;
int t[MAXN], ans[MAXN], n, m, tot;
int head[MAXN], nxt[MAXN << 1], to[MAXN << 1], ind;
inline void add_edge(int u, int v) {
  nxt[++ind] = head[u];
  head[u] = ind;
  to[ind] = v;
}
inline void add(int u, int v) {
  add_edge(u, v);
  add_edge(v, u);
}
vector<int> id[MAXN];
int cnt[MAXN];
inline void init(void) {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = 1; i <= m; ++i) scanf("%d%d", &u, &v), add(u, v);
  int x;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    id[x].push_back(i);
    cnt[i] = 1;
  }
}
int tag[MAXN];
bool solve(int x) {
  if (id[x].size() == 0) return true;
  vector<int> vis;
  for (int i = 0; i < id[x].size(); ++i) {
    int u = id[x][i];
    if (cnt[u] != x || tag[u]) return false;
    for (int i = head[u]; i; i = nxt[i]) {
      int v = to[i];
      tag[v] = 1;
      vis.push_back(v);
    }
    ans[++tot] = u;
  }
  for (auto u : vis) cnt[u] += tag[u], tag[u] = 0;
  vis.clear();
  return true;
}
inline void work(void) {
  for (int i = 1; i <= n; ++i) {
    if (solve(i) == false) {
      printf("-1");
      return;
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
}
int main() {
  init();
  work();
  return 0;
}
