#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#pragma GCC optimize("-O2")
const int LIM = 5e5 + 5, MOD = 998244353;
int t, n, m, k, x, y;
vector<int> adj[LIM];
int mex[LIM];
int gogo(int node, int val) {
  if (mex[node] + 1 != val) {
    return 0;
  }
  for (auto v : adj[node]) {
    if (mex[v] == val - 1) {
      mex[v]++;
    }
  }
  return 1;
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  vector<int> order[n + 1];
  vector<int> blog(n + 1);
  for (int i = 1; i < n + 1; i++) {
    cin >> x;
    blog[i] = x;
    order[x].push_back(i);
  }
  vector<int> ans;
  for (int i = 1; i < n + 1; i++) {
    for (auto j : order[i]) {
      if (!gogo(j, i)) {
        cout << -1 << "\n";
        return;
      }
      ans.push_back(j);
    }
  }
  copy(begin(ans), end(ans), ostream_iterator<int>(cout, " "));
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) solve();
}
