#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vll = vector<ll>;
using graph = vector<vi>;
const int MAXN = 5e5 + 5;
const int MAXM = 2e2 + 5;
vi ans[MAXN];
graph g;
int cor[MAXN], seen[MAXN];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  g.assign(n + 1, vi());
  int u, v;
  for (int i = 1, x; i <= m; ++i) {
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &u);
    cor[i] = u;
    ans[u].push_back(i);
  }
  vi res;
  for (int i = 1; i <= n; ++i) {
    for (int x : ans[i]) {
      res.push_back(x);
    }
  }
  bool ok = 1;
  for (auto u : res) {
    for (auto v : g[u]) {
      seen[cor[v]] = u;
    }
    int mx = g[u].size() + 1;
    for (int i = 1; mx == g[u].size() + 1 && i <= g[u].size(); ++i) {
      if (seen[i] != u) {
        mx = i;
      }
    }
    if (mx != cor[u]) ok = 0;
  }
  if (ok) {
    for (auto u : res) {
      printf("%d ", u);
    }
  } else {
    printf("-1\n");
  }
}
