#include <bits/stdc++.h>
using namespace std;
void fail() {
  cout << "-1" << endl;
  exit(0);
}
template <typename T>
vector<T> compress(vector<T> A) {
  sort(A.begin(), A.end());
  A.erase(unique(A.begin(), A.end()), A.end());
  return A;
}
int main() {
  int N, M;
  cin >> N >> M;
  static vector<int> edges[500000];
  for (int i = 0; i < M; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  vector<int> T(N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &T[i]);
    T[i]--;
  }
  vector<int> order(N);
  for (int i = 0; i < N; i++) order[i] = i;
  sort(order.begin(), order.end(), [&](int i, int j) { return T[i] < T[j]; });
  bitset<500000> visited;
  for (int i : order) {
    visited[i] = 1;
    vector<int> nums;
    for (int j : edges[i])
      if (visited[j]) nums.push_back(T[j]);
    nums = compress(nums);
    nums.push_back(1e9);
    int res = 0;
    while (nums[res] == res) res++;
    if (T[i] != res) fail();
  }
  for (int i : order) cout << i + 1 << " ";
  cout << endl;
  return 0;
}
