#include <bits/stdc++.h>
using namespace std;
const long long md = 1e9 + 7;
const int N = 510000;
const int M = 510000;
const double eps = 1e-9;
struct Edge {
  int v, next;
} edge[M * 2];
int e, head[N];
void erase() {
  e = 0;
  memset(head, -1, sizeof(head));
}
void increase(int u, int v) {
  edge[e].v = v;
  edge[e].next = head[u];
  head[u] = e++;
}
int an[N];
int q[N], l, r;
int ans[N], cnt;
int mi[N];
bool visit[N];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  int i, j, k;
  int u, v, w;
  int a, b, c, d;
  int z;
  cin >> n >> m;
  erase();
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    increase(u, v);
    increase(v, u);
  }
  l = r = 0;
  memset(visit, 0, sizeof(visit));
  memset(mi, 0, sizeof(mi));
  for (i = 1; i <= n; i++) {
    cin >> an[i];
    mi[i] = 1;
    if (an[i] == 1) {
      q[r++] = i;
      visit[i] = 1;
    }
  }
  cnt = 0;
  while (l < r) {
    int k = q[l++];
    if (mi[k] == an[k])
      ans[cnt++] = k;
    else
      continue;
    for (int t = head[k]; t != -1; t = edge[t].next) {
      int v = edge[t].v;
      if (mi[v] == an[k]) mi[v] = an[k] + 1;
      if (!visit[v] && an[v] == mi[v]) {
        visit[v] = 1;
        q[r++] = v;
      }
    }
  }
  if (cnt == n) {
    for (i = 0; i < cnt; i++) cout << ans[i] << " ";
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
