#include <bits/stdc++.h>
using namespace std;
void pr(long long x) { cout << x; }
void prt(long long x) { cout << x << endl; }
long long mod = 1e9 + 7;
vector<long long> adj[500009];
void sol() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  map<long long, long long> mp;
  long long t[n + 1];
  vector<pair<long long, long long>> v;
  for (long long i = 1; i <= n; i++) {
    cin >> t[i];
    mp[i] = t[i];
    v.push_back(make_pair(t[i], i));
  }
  sort(v.begin(), v.end());
  long long fl = 0;
  vector<long long> ans;
  set<long long> st;
  long long fl1 = 0;
  if (v[0].first > 1) {
    cout << -1 << endl;
    return;
  }
  for (long long i = 0; i < v.size(); i++) {
    if (i > 0 && v[i].first == v[i - 1].first) {
      for (long long j = 0; j < adj[v[i].second].size(); j++) {
        if (t[adj[v[i].second][j]] < v[i].first)
          st.insert(t[adj[v[i].second][j]]);
        if (t[adj[v[i].second][j]] == v[i].first) fl = 1;
      }
      if (st.size() == (v[i].first - 1)) {
        ans.push_back(v[i].second);
        st.clear();
      } else {
        fl1 = 1;
        break;
      }
    } else {
      for (long long j = 0; j < adj[v[i].second].size(); j++) {
        if (t[adj[v[i].second][j]] < v[i].first)
          st.insert(t[adj[v[i].second][j]]);
        if (t[adj[v[i].second][j]] == v[i].first) fl = 1;
      }
      if (st.size() == (v[i].first - 1)) {
        ans.push_back(v[i].second);
        st.clear();
      } else {
        fl1 = 1;
        break;
      }
    }
  }
  if (fl == 1 || fl1 == 1)
    cout << -1 << endl;
  else {
    for (auto itt : ans) {
      cout << itt << " ";
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long T = 1;
  while (T--) {
    sol();
  }
  return 0;
}
