#include <bits/stdc++.h>
typedef int64_t ll;
typedef int32_t li;
typedef int16_t si;
const ll MOD = 1000000007;
const ll N_limit = 1000000;
const ll INF = 9e18;
void quickSort(std::vector<int32_t> &AR, li low, li high,
               std::vector<int32_t> &blog_n) {
  li left_index = low;
  li right_index = high;
  li pivot = AR[(left_index + right_index) / 2];
  while (left_index <= right_index) {
    while (AR[left_index] < pivot) left_index++;
    while (AR[right_index] > pivot) right_index--;
    if (left_index <= right_index) {
      std::swap(AR[left_index], AR[right_index]);
      std::swap(blog_n[left_index], blog_n[right_index]);
      left_index++;
      right_index--;
    }
  }
  if (right_index > low) quickSort(AR, low, right_index, blog_n);
  if (left_index < high) quickSort(AR, left_index, high, blog_n);
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  li n, m;
  std::cin >> n >> m;
  std::vector<std::vector<li>> mat;
  mat.resize(n + 1);
  std::vector<int32_t> edges;
  edges.resize(n + 1);
  li a, b;
  for (li ii = 1; ii <= m; ii++) {
    std::cin >> a >> b;
    ++edges[a];
    mat[a].push_back(b);
    ++edges[b];
    mat[b].push_back(a);
  }
  std::vector<int32_t> th;
  th.resize(n + 1);
  std::vector<int32_t> blog_n;
  blog_n.resize(n + 1);
  for (li ii = 1; ii <= n; ii++) {
    blog_n[ii] = ii;
    std::cin >> th[ii];
  }
  quickSort(th, 1, n, blog_n);
  std::vector<int32_t> distr;
  distr.resize(n + 1);
  li theme;
  li blog;
  bool ind;
  for (li ii = 1; ii <= n; ii++) {
    theme = th[ii];
    blog = blog_n[ii];
    if (edges[blog] < theme - 1) {
      std::cout << -1 << std::endl;
      return 0;
    }
    if (edges[blog] == 0) {
      if (theme == 1) {
        distr[blog] = 1;
        continue;
      } else {
        std::cout << -1 << std::endl;
        return 0;
      }
    }
    std::vector<bool> thms;
    thms.resize(theme + 1);
    for (li jj = 0; jj <= edges[blog] - 1; jj++) {
      if (distr[mat[blog][jj]]) {
        thms[distr[mat[blog][jj]]] = true;
      }
    }
    ind = true;
    thms[theme] = !thms[theme];
    for (li jj = 1; jj <= theme; jj++) ind *= thms[jj];
    if (ind)
      distr[blog] = theme;
    else {
      std::cout << -1 << std::endl;
      return 0;
    }
  }
  for (li ii = 1; ii <= n - 1; ii++) {
    std::cout << blog_n[ii] << " ";
  }
  std::cout << blog_n[n] << std::endl;
  return 0;
}
