#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 5e5 + 1;
bool vis[maxn];
bool poss = true;
void dfs(long long int node, vector<long long int> adj[], long long int top[],
         long long int prev, map<long long int, vector<long long int>>& ans) {
  vis[node] = true;
  ans[prev].push_back(node);
  for (auto el : adj[node]) {
    if (vis[el] == true and top[el] == prev) {
      poss = false;
      return;
    } else if (!vis[el])
      dfs(el, adj, top, top[el], ans);
  }
}
void checkNegihbours(long long int node, vector<long long int> adj[],
                     long long int topic[]) {
  vis[node] = true;
  set<long long int> st;
  bool cov = false;
  for (auto el : adj[node]) {
    if (vis[el] and topic[el] >= topic[node]) {
      cov = true;
      poss = false;
      return;
    } else if (vis[el]) {
      cov = true;
      if (!st.count(topic[el])) st.insert(topic[el]);
    }
  }
  if (cov and st.size() == topic[node] - 1) {
  } else if (cov) {
    poss = false;
  } else if (!cov and topic[node] > 1)
    poss = false;
}
int32_t main() {
  long long int n, m;
  cin >> n >> m;
  long long int dm = m;
  vector<long long int> adj[n + 1];
  while (dm--) {
    long long int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long int topic[n + 1];
  map<long long int, vector<long long int>> ans;
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    topic[i] = x;
    ans[x].push_back(i);
  }
  memset(vis, false, sizeof(vis));
  for (auto el : ans) {
    for (auto blog : el.second) {
      if (!poss) break;
      checkNegihbours(blog, adj, topic);
    }
    if (!poss) break;
  }
  if (!poss) {
    cout << -1 << "\n";
    return 0;
  }
  for (auto el : ans) {
    for (auto els : el.second) cout << els << " ";
  }
}
