#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> adj(n, vector<long long>());
  while (m--) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  vector<pair<long long, long long>> topic(n);
  vector<long long> og(n);
  for (long long i = 0; i < n; i++) {
    cin >> og[i];
    topic[i].first = og[i] - 1;
    topic[i].second = i;
  }
  for (long long i = 0; i < n; i++) {
    for (auto neigh : adj[i])
      if (topic[i].first == topic[neigh].first) {
        cout << "-1" << endl;
        return 0;
      }
  }
  sort(topic.begin(), topic.end());
  vector<long long> ans;
  vector<bool> visited(n, false);
  for (long long i = 0; i < n; i++) {
    long long blog = topic[i].second;
    long long req = topic[i].first;
    set<long long> st;
    for (auto child : adj[blog])
      if (visited[child]) st.insert(og[child]);
    if (st.size() != req) {
      cout << "-1" << endl;
      return 0;
    }
    ans.push_back(blog);
    visited[blog] = true;
  }
  for (auto it : ans) cout << it + 1 << " ";
  cout << endl;
}
