#include <bits/stdc++.h>
using lnt = long long;
constexpr lnt INF = 2e18;
struct FIO {
  FIO() {
    std::cin.tie(0);
    std::cout.tie(0);
    std::ios_base::sync_with_stdio(0);
    std::cout << std::fixed << std::setprecision(15);
  }
} fIO;
template <typename T>
std::vector<int> sort_indexes(const std::vector<T> &v) {
  std::vector<int> idx(v.size());
  std::iota(idx.begin(), idx.end(), 0);
  std::sort(idx.begin(), idx.end(),
            [&v](int i1, int i2) { return v[i1] < v[i2]; });
  return idx;
}
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<std::vector<int> > g(n);
  std::vector<std::pair<int, int> > edges;
  for (int i = 0; i < (m); ++i) {
    int a, b;
    std::cin >> a >> b;
    a--;
    b--;
    edges.emplace_back(a, b);
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  std::vector<int> t(n);
  for (int i = 0; i < (n); ++i) std::cin >> t[i];
  std::vector<int> ans;
  auto idx = sort_indexes(t);
  std::vector<int> topics(n, 1);
  for (auto i : idx) {
    if (topics[i] != t[i]) {
      std::cout << (-1) << '\n';
      return 0;
    }
    ans.emplace_back(i);
    for (auto to : g[i]) {
      if (topics[to] == topics[i]) topics[to]++;
    }
  }
  for (auto x : ans) std::cout << x + 1 << ' ';
  std::cout << '\n';
}
