#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, m, t[N], deg[N], pr[N], visited[N], help;
pair<int, int> e[N];
vector<int> gr[N], adj[N];
bool cmp(pair<int, int> a, pair<int, int> b) {
  return min(t[a.first], t[a.second]) < min(t[b.first], t[b.second]);
}
bool cmp1(int a, int b) { return t[a] < t[b]; }
vector<int> ans;
set<int> s[N];
void dfs(int v, int p) {
  visited[v] = help;
  for (int u : gr[v]) {
    if (!visited[u]) dfs(u, v);
  }
  ans.push_back(v);
}
void topological_sort() {
  ans.clear();
  for (int i = 1; i <= n; ++i) {
    if (!visited[i]) {
      help++;
      dfs(i, 0);
    }
  }
  reverse(ans.begin(), ans.end());
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 1, a, b; i <= m; i++) {
    cin >> a >> b;
    e[i] = {a, b};
    deg[a]++;
    deg[b]++;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) cin >> t[i];
  for (int i = 1; i <= n; i++) {
    sort(adj[i].begin(), adj[i].end(), cmp1);
    for (int g : adj[i]) {
      if (t[g] < t[i])
        gr[g].push_back(i);
      else if (t[g] == t[i]) {
        cout << -1;
        exit(0);
      }
    }
  }
  topological_sort();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= deg[i] + 1; j++) s[i].insert(j);
  }
  for (int i : ans) {
    for (int j : adj[i]) {
      s[j].erase(t[i]);
    }
    pr[i] = *s[i].begin();
    if (pr[i] != t[i]) {
      cout << -1;
      exit(0);
    }
  }
  for (int i : ans) cout << i << ' ';
}
