#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500010;
struct P {
  int id, v;
} p[MAXN];
int n, m, x, y, eg, hd[MAXN], nx[2 * MAXN], ver[2 * MAXN], val[MAXN], cnt[MAXN];
void add_edge(int x, int y) {
  ver[++eg] = y;
  nx[eg] = hd[x];
  hd[x] = eg;
  return;
}
bool cmp(P a, P b) { return a.v < b.v; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    add_edge(x, y), add_edge(y, x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i].v);
    p[i].id = i, val[i] = p[i].v;
  }
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int cur = 1;
    for (int j = hd[p[i].id]; j; j = nx[j]) {
      cnt[val[ver[j]]]++;
    }
    while (cnt[cur]) {
      cur++;
    }
    if (cur != p[i].v) {
      printf("-1\n");
      return 0;
    }
    for (int j = hd[p[i].id]; j; j = nx[j]) {
      cnt[val[ver[j]]]--;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", p[i].id);
  }
  printf("\n");
  return 0;
}
