#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1000000007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
set<int> h[500100];
set<pair<int, int> > g[500100];
int t[500100];
vector<pair<int, int> > v, e;
int vis[500100];
vector<int> ans;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    e.push_back({a, b});
  }
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    v.push_back({t[i], i});
  }
  for (auto p : e) {
    h[p.first].insert(t[p.second]);
    h[p.second].insert(t[p.first]);
  }
  for (int i = 1; i <= n; i++) {
    int j = 0;
    for (auto p : h[i]) {
      j++;
      g[i].insert({p, j});
    }
    g[i].insert({0, 0});
  }
  sort(v.begin(), v.end());
  for (auto p : v) {
    int u = p.second, i = p.first;
    if (g[u].find({i - 1, i - 1}) != g[u].end() &&
        g[u].find({i, i}) == g[u].end()) {
      ans.push_back(p.second);
    } else {
      cout << "-1\n";
      return 0;
    }
  }
  for (auto p : ans) cout << p << " ";
  cout << "\n";
  return 0;
}
