#include <bits/stdc++.h>
using namespace std;
int hd[500010], mn[500010], t[500010];
vector<int> e[500010];
int ans[500010], tot;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    if (t[i] == 1) q.push(i);
    mn[i] = 1;
  }
  int f = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    if (mn[u] == t[u]) {
      ans[tot++] = u;
      for (int i = 0; i < e[u].size(); i++) {
        int v = e[u][i];
        if (mn[v] == mn[u]) {
          mn[v]++;
          if (mn[v] == t[v]) q.push(v);
        }
      }
    } else if (mn[u] > t[u])
      f = -1;
  }
  if (tot != n) f = -1;
  if (f == 1)
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  else
    printf("-1");
}
