#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
using namespace std;
const int N = 5e5 + 2;
int cur[N];
vector<int> adj[N];
set<int> s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(cur, -1, sizeof(cur));
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<pair<int, int> > vpos;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    vpos.push_back(pair<int, int>(x, i));
  }
  for (int i = 1; i <= n; ++i) s.insert(i);
  sort(vpos.begin(), vpos.end());
  for (pair<int, int> par : vpos) {
    int val = par.first, x = par.second;
    for (int u : adj[x]) {
      if (cur[u] != -1) s.erase(cur[u]);
    }
    auto p = s.begin();
    if ((*p) != val) {
      cout << -1 << endl;
      return 0;
    }
    for (int u : adj[x])
      if (cur[u] != -1) s.insert(cur[u]);
    cur[x] = *p;
  }
  for (pair<int, int> par : vpos) cout << par.second + 1 << " ";
  cout << endl;
  return 0;
}
