#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<set<int>> p(n);
  vector<pair<int, int>> rebra;
  for (int j = 0; j < m; ++j) {
    int x, y;
    cin >> x >> y;
    rebra.push_back({x - 1, y - 1});
  }
  vector<int> tem(n);
  for (int k = 0; k < n; ++k) {
    cin >> tem[k];
  }
  bool flag = true;
  for (int l = 0; l < m; ++l) {
    int a = rebra[l].first;
    int b = rebra[l].second;
    if (tem[a] == tem[b]) {
      flag = false;
    }
    if (tem[a] < tem[b]) {
      p[b].insert(tem[a]);
    }
    if (tem[a] > tem[b]) {
      p[a].insert(tem[b]);
    }
  }
  for (int i1 = 0; i1 < n; ++i1) {
    if (p[i1].size() != tem[i1] - 1) {
      flag = false;
    }
  }
  if (flag == false) {
    cout << -1;
  } else {
    set<pair<int, int>> ans;
    for (int j = 0; j < n; ++j) {
      ans.insert({tem[j], j + 1});
    }
    for (auto l : ans) {
      cout << l.second << ' ';
    }
  }
  return 0;
}
