#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> gr;
int main() {
  ios::sync_with_stdio(true);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  gr.resize(n + 1, vector<int>());
  int a, b;
  while (m--) {
    cin >> a >> b;
    gr[a].emplace_back(b);
    gr[b].emplace_back(a);
  }
  vector<int> t(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
  }
  for (int i = 1; i <= n; i++) {
    set<int> s;
    for (auto j : gr[i]) {
      if (t[i] == t[j]) {
        cout << -1;
        return 0;
      } else {
        if (t[j] < t[i]) {
          s.insert(t[j]);
        }
      }
    }
    if (s.size() != t[i] - 1) {
      cout << -1;
      return 0;
    }
  }
  vector<pair<int, int>> p(n + 1);
  for (int i = 1; i <= n; i++) {
    p[i].first = t[i], p[i].second = i;
  }
  sort(p.begin(), p.end());
  for (int i = 1; i <= n; i++) {
    cout << p[i].second << " ";
  }
}
