#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 1;
vector<int> g[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> x(m), y(m);
  for (int i = 0; i < m; ++i) {
    cin >> x[i] >> y[i];
    g[x[i]].push_back(y[i]);
    g[y[i]].push_back(x[i]);
  }
  vector<int> t(n + 1);
  vector<pair<int, int> > p;
  for (int i = 1; i <= n; ++i) {
    cin >> t[i];
    p.push_back({t[i], i});
  }
  for (int i = 0; i < m; ++i) {
    if (t[x[i]] == t[y[i]]) {
      cout << "-1";
      return 0;
    }
  }
  sort(p.begin(), p.end());
  for (auto i : p) {
    int u = i.second;
    vector<int> cnt(i.first);
    for (int j : g[u]) {
      if (t[j] < i.first) cnt[t[j]]++;
    }
    for (int j = 1; j < i.first; ++j) {
      if (!cnt[j]) {
        cout << "-1";
        return 0;
      }
    }
  }
  for (auto i : p) {
    cout << i.second << ' ';
  }
}
