#include <bits/stdc++.h>
using namespace std;
vector<int> e[500005];
int p[500005];
struct node {
  int x, t;
} a[500005];
int cmp(node a, node b) { return a.t < b.t; }
int t[500005];
int vis[500005];
int main() {
  int T, ca = 0;
  int n, m;
  memset(vis, 0, sizeof vis);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    e[i].clear();
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i].t;
    a[i].x = i;
    t[i] = a[i].t;
  }
  sort(a + 1, a + 1 + n, cmp);
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (flag) break;
    int now = a[i].x;
    int tar = a[i].t;
    vis[now] = 1;
    for (int i = 1; i <= tar; i++) p[i] = 0;
    for (int k = 0; k < e[now].size(); k++) {
      int nex = e[now][k];
      if (vis[nex]) {
        if (t[nex] <= tar) p[t[nex]]++;
      }
    }
    for (int i = 1; i < tar; i++)
      if (p[i] == 0) {
        flag = 1;
        break;
      }
    if (p[tar]) flag = 1;
  }
  if (flag == 1) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i].x;
    if (i == n)
      cout << endl;
    else
      cout << " ";
  }
  return 0;
}
