#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long double PI = acosl(-1.0);
long long temp;
vector<long long> adj[500001];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<pair<long long, long long>> topic;
  long long to;
  for (long long i = 1; i < n + 1; i++) {
    cin >> to;
    topic.push_back(make_pair(to, i));
  }
  sort(topic.begin(), topic.end());
  long long ans[n + 1];
  for (long long i = 1; i < n + 1; i++) ans[i] = mod;
  for (long long i = 0; i < topic.size(); i++) {
    long long temp[adj[topic[i].second].size() + 2];
    memset(temp, 0, sizeof(temp));
    long long ssp = adj[topic[i].second].size() + 2;
    for (long long j : adj[topic[i].second]) {
      if (ans[j] < ssp) temp[ans[j]] = 1;
    }
    long long numb = n;
    for (long long j = 1; j < n + 2; j++) {
      if (temp[j] == 0) {
        numb = j;
        break;
      }
    }
    if (numb != topic[i].first) {
      cout << -1 << '\n';
      return 0;
    }
    ans[topic[i].second] = topic[i].first;
  }
  for (long long i = 0; i < topic.size(); i++) cout << topic[i].second << " ";
  return 0;
}
