#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> adj(n);
  for (long long i = 0; i < m; i++) {
    long long tmp1, tmp2;
    cin >> tmp1 >> tmp2;
    tmp1--;
    tmp2--;
    adj[tmp1].push_back(tmp2);
    adj[tmp2].push_back(tmp1);
  }
  queue<long long> q;
  vector<pair<long long, long long>> desired(n);
  vector<long long> desired2(n);
  for (long long i = 0; i < n; i++) {
    long long t1;
    cin >> t1;
    desired[i] = {t1, i};
    desired2[i] = t1;
  }
  sort(desired.begin(), desired.end());
  vector<long long> next_available(n, 1);
  long long ok = 1;
  for (auto p : desired) {
    long long idx = p.second;
    long long desired_topic = p.first;
    set<long long> neighs;
    for (auto c : adj[idx]) {
      neighs.insert(desired2[c]);
    }
    long long i;
    for (i = 1;; i++)
      if (!neighs.count(i)) break;
    if (i != desired_topic) {
      ok = 0;
      break;
    }
  }
  if (!ok)
    cout << -1 << endl;
  else {
    for (auto p : desired) cout << p.second + 1 << " ";
    cout << endl;
  }
  return 0;
}
