#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<long long> adj[500010];
vector<pair<long long, long long> > massiv;
long long color[500010];
long long color1[500010];
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    massiv.push_back(make_pair(x, i));
    color[i] = x;
  }
  sort((massiv).begin(), (massiv).end());
  for (long long i = 0; i < n; i++) {
    set<long long> sosedi;
    for (auto to : adj[massiv[i].second]) {
      sosedi.insert(color1[to]);
    }
    vector<long long> el;
    el.push_back(0);
    for (auto to : sosedi) el.push_back(to);
    if (sosedi.find(massiv[i].first) != sosedi.end()) {
      cout << -1 << "\n";
      return 0;
    }
    for (long long j = 0; j < (long long)el.size() - 1; j++) {
      if (el[j + 1] - el[j] > 1) {
        if (el[j] + 1 != massiv[i].first) {
          cout << -1 << "\n";
          return 0;
        }
        break;
      }
    }
    if (el.back() + 1 != massiv[i].first) {
      cout << -1 << "\n";
      return 0;
    }
    color1[massiv[i].second] = massiv[i].first;
  }
  for (long long i = 0; i < n; i++) {
    cout << massiv[i].second << " ";
  }
  cout << "\n";
  return 0;
}
