#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long mod = 1000000007;
const double PI = acos(-1);
void solve() {
  int n, m, u, v;
  cin >> n >> m;
  vector<int> g[n];
  vector<pair<int, int> > edges(m);
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
    edges[i] = {u, v};
  }
  pair<int, int> t[n];
  for (int i = 0; i < n; i++) {
    cin >> t[i].first;
    t[i].second = i;
  }
  for (int i = 0; i < m; i++) {
    if (t[edges[i].first].first == t[edges[i].second].first) {
      cout << "-1\n";
      return;
    }
  }
  sort(t, t + n);
  vector<int> done[n];
  for (int i = 0; i < n; i++) {
    int val = t[i].first;
    u = t[i].second;
    if ((int)done[u].size() != val - 1) {
      cout << "-1\n";
      return;
    }
    for (int &j : g[u]) {
      if (done[j].empty() || done[j].back() != val) done[j].push_back(val);
    }
  }
  for (int i = 0; i < n; i++) cout << t[i].second + 1 << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
}
