#include <bits/stdc++.h>
using namespace std;
long long const nax = 5 * 1e5 + 5;
vector<long long int> a[nax], b(nax), vis(nax), ans;
void dfs(long long v) {
  long long mx = 0;
  for (auto it : a[v]) {
    if (b[it] < b[v] and !vis[it])
      dfs(it);
    else if (b[it] == b[v]) {
      cout << -1;
      exit(0);
    }
    mx = max(mx, b[it]);
  }
  mx = max(mx, b[v]);
  vector<bool> first(mx + 1, 0);
  for (auto it : a[v]) first[b[it]] = 1;
  for (long long i = 1; i <= mx; i++) {
    if (!first[i]) {
      if (i == b[v])
        break;
      else {
        cout << -1;
        exit(0);
      }
    }
  }
  ans.push_back(v);
  vis[v] = 1;
}
bool mc(long long x, long long y) { return b[x] < b[y]; }
void solve() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) cin >> b[i];
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) dfs(i);
  for (auto it : ans) cout << it << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  long long t = 1;
  while (t--) {
    solve();
    cout << endl;
  }
  cin.get();
  return 0;
}
