#include <bits/stdc++.h>
using namespace std;
const int N = 5 * 1e5 + 5;
int c[N], vis[N];
vector<int> g[N];
vector<pair<int, int> > ans;
bool DFS(int u) {
  vis[u] = 1;
  bool ok = 1;
  int now = c[u];
  int has[now + 1];
  memset(has, 0, sizeof has);
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (c[v] == now)
      ok = 0;
    else if (c[v] < now)
      has[c[v]]++;
    if (!vis[v]) ok &= DFS(v);
  }
  for (int i = 1; i < now; i++) {
    if (!has[i]) ok = 0;
  }
  ans.push_back({now, u});
  return ok;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, u, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) cin >> c[i];
  bool ok = 1;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) ok &= DFS(i);
  }
  if (!ok)
    cout << -1 << '\n';
  else {
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) cout << ans[i].second << " ";
    cout << '\n';
  }
  return 0;
}
