#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LONGINF = 9223372036854775807;
const long long MOD = 998244353;
vector<pair<int, int>> links;
vector<int> t;
vector<vector<int>> blogs;
vector<set<int>> checker;
void solve() {
  int n, m;
  cin >> n >> m;
  links.resize(m);
  ;
  for (int i = 0; i < m; ++i) cin >> links[i].first >> links[i].second;
  t.resize(n);
  for (int i = 0; i < n; ++i) cin >> t[i];
  ;
  bool flag = true;
  blogs.resize(n + 1);
  ;
  int maxT = 1;
  for (int i = 0; i < n; ++i) {
    blogs[t[i]].push_back(i + 1);
    ;
    maxT = max(maxT, t[i]);
  }
  checker.resize(n + 1);
  ;
  for (int i = 0; i < m; ++i) {
    if (t[links[i].first - 1] == t[links[i].second - 1]) {
      flag = false;
      break;
    }
    if (t[links[i].first - 1] < t[links[i].second - 1])
      checker[links[i].second].insert(t[links[i].first - 1]);
    else
      checker[links[i].first].insert(t[links[i].second - 1]);
  }
  for (int i = 0; i < n; ++i) {
    if (checker[i + 1].size() != t[i] - 1) {
      flag = false;
      break;
    }
  }
  if (!flag)
    cout << -1 << '\n';
  else
    for (int i = 0; i < maxT; ++i)
      for (auto j : blogs[i + 1]) cout << j << ' ';
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  std::ios_base::sync_with_stdio(0);
  bool mult = false;
  if (mult) {
    int t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
}
