#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 20;
int t[N], vist[N];
set<int> s[N];
vector<int> adj[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  queue<int> q;
  for (int i = 1; i <= n; ++i) {
    cin >> t[i];
    if (t[i] == 1) {
      q.push(i);
      vist[i] = 1;
    }
  }
  bool ok = true;
  for (int u = 1; u <= n; ++u) {
    for (int v : adj[u]) ok = ok && (t[u] != t[v]);
  }
  if (!ok) {
    cout << -1 << endl;
    exit(0);
  }
  vector<int> ans;
  while (int(q.size())) {
    int u = q.front();
    q.pop();
    ans.push_back(u);
    for (int v : adj[u]) {
      if (!vist[v]) {
        s[v].insert(t[u]);
        if (int(s[v].size()) + 1 == t[v]) {
          vist[v] = 1;
          q.push(v);
        }
      }
    }
  }
  if (int(ans.size()) == n) {
    for (int x : ans) cout << x << " ";
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
