#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n, m;
  cin >> n >> m;
  vector<vector<ll>> adj(n);
  for (ll i = 0; i < m; i++) {
    ll a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<pair<ll, ll>> t(n);
  for (ll i = 0; i < n; i++) {
    ll x;
    cin >> x;
    t[i] = {x, i};
  }
  sort(begin(t), end(t));
  vector<ll> mex(n, 1);
  for (auto e : t) {
    if (e.first != mex[e.second]) {
      cout << -1 << endl;
      return 0;
    }
    for (ll x : adj[e.second]) {
      if (mex[x] == mex[e.second]) mex[x]++;
    }
  }
  for (auto e : t) {
    cout << e.second + 1 << " ";
  }
  cout << endl;
}
