#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> adj[n + 1];
  for (long long i = 0; i < m; ++i) {
    long long u, v;
    cin >> u >> v;
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
  }
  vector<long long> b(n + 1);
  map<long long, vector<long long> > om;
  for (long long i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    b[i] = x;
    om[x].emplace_back(i);
  }
  vector<long long> out;
  for (auto i : om) {
    for (auto j : i.second) {
      bool arr[i.first];
      memset(arr, false, sizeof(arr));
      for (auto k : adj[j]) {
        if (b[k] == i.first) {
          cout << -1 << "\n";
          return;
        }
        if (b[k] < i.first) arr[b[k]] = true;
      }
      for (long long l = 1; l < i.first; ++l)
        if (!arr[l]) {
          cout << -1 << "\n";
          return;
        }
      out.emplace_back(j);
    }
  }
  for (auto i : out) cout << i << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
