#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
using pii = pair<long long, long long>;
template <typename T>
using prior = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using Prior = priority_queue<T>;
const long long INF = 1E18;
const long long mod = 1E9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, u, v, fl = 1;
  cin >> n >> m;
  vector<long long> adj[n], col(n), ncol(n, 1);
  while (m--)
    cin >> u >> v, --u, --v, adj[u].emplace_back(v), adj[v].emplace_back(u);
  for (auto &x : col) cin >> x;
  vector<long long> cnt_sort[n], seq;
  for (long long i = 0; i < n; ++i) cnt_sort[col[i] - 1].emplace_back(i);
  for (long long i = 0; i < n; ++i) {
    for (auto x : cnt_sort[i]) seq.emplace_back(x);
  }
  for (auto now : seq) {
    for (auto x : adj[now]) {
      if (ncol[x] == col[now]) ++ncol[x];
    }
  }
  for (long long i = 0; i < n; ++i) fl &= ncol[i] == col[i];
  if (fl) {
    for (auto x : seq) cout << x + 1 << " ";
    cout << "\n";
  } else {
    cout << -1 << "\n";
  }
  return 0;
}
