#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, nxxt;
} e[500006 << 1];
int n, m, a[500006], head[500006], cnt = 1, b[500006], c[500006], tot;
bool vis[500006];
inline void ins(int u, int v) {
  e[cnt].to = v;
  e[cnt].nxxt = head[u];
  head[u] = cnt++;
}
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    ins(x, y);
    ins(y, x);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), b[i] = i;
  sort(b + 1, b + 1 + n, cmp);
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    int x = b[i];
    tot = 0;
    for (int j = head[x]; j; j = e[j].nxxt) {
      int to = e[j].to;
      if (vis[to]) c[++tot] = a[to];
    }
    sort(c + 1, c + 1 + tot);
    for (int j = 1; j <= tot; j++)
      if (c[j] == a[x]) {
        flag = false;
        break;
      }
    for (int j = 1; j < tot; j++) {
      if (c[j] + 1 < c[j + 1] && c[j] + 1 < a[x]) {
        flag = false;
        break;
      }
    }
    if (tot && c[1] > a[x] && a[x] != 1) {
      flag = false;
      break;
    }
    if (tot && c[1] > 1) {
      flag = false;
      break;
    }
    if (tot && c[tot] + 1 < a[x]) {
      flag = false;
      break;
    }
    if (!flag) break;
    vis[x] = 1;
  }
  if (flag) {
    for (int i = 1; i <= n; i++) printf("%d ", b[i]);
    puts("");
  } else
    puts("-1");
}
