#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> data(n + 1);
  vector<vector<long long>> link(n + 1, vector<long long>());
  long long a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    link[a].push_back(b);
    link[b].push_back(a);
  }
  map<long long, vector<long long>> cnt;
  for (int i = 1; i <= n; i++) {
    cin >> data[i];
    if (cnt.find(data[i]) == cnt.end()) cnt[data[i]] = vector<long long>();
    cnt[data[i]].push_back(i);
  }
  vector<long long> can(n + 1, 1);
  vector<long long> ans;
  long long left = n;
  bool valid = true;
  for (long long i = 1; i <= n; i++) {
    for (auto p : cnt[i]) {
      if (can[p] != i) {
        valid = false;
        break;
      }
      left--;
      ans.push_back(p);
      for (auto next : link[p]) {
        if (can[next] == i) can[next] = i + 1;
      }
    }
    if (!valid) break;
  }
  if (!valid)
    cout << -1 << endl;
  else {
    for (auto k : ans) cout << k << " ";
    cout << endl;
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long t = 1;
  while (t > 0) {
    t--;
    solve();
  }
  return 0;
}
