#include <bits/stdc++.h>
using namespace std;
int n, m, a[500010], b[500010], fa[500010], tot, head[500010], vis[500010];
struct node {
  int to, next;
} e[500010 << 1];
int cmp(int x, int y) { return a[x] < a[y]; }
void add_edge(int u, int v) {
  tot++, e[tot].to = v, e[tot].next = head[u], head[u] = tot;
}
void init() {
  int i, u, v;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    add_edge(u, v), add_edge(v, u);
  }
  for (i = 1; i <= n; i++) b[i] = i, scanf("%d", &a[i]);
}
void solve() {
  int i, c, v;
  sort(b + 1, b + 1 + n, cmp);
  for (i = 1; i <= n; i++) {
    if (fa[b[i]] + 1 != a[b[i]]) {
      printf("-1\n");
      return;
    }
    fa[b[i]] = a[a[i]], vis[b[i]] = 1;
    for (c = head[b[i]]; c; c = e[c].next) {
      v = e[c].to;
      if (!vis[v])
        if (fa[v] + 1 == a[b[i]]) fa[v] = a[b[i]];
    }
  }
  for (i = 1; i <= n; i++) printf("%d ", b[i]);
  printf("\n");
}
int main() {
  init();
  solve();
  return 0;
}
