#include <bits/stdc++.h>
using namespace std;
int n, m;
int Arr[500001];
vector<int> graph[500001];
vector<int> topic[500001];
vector<int> colors;
bool check() {
  for (int i = 0; i < colors.size(); i++) {
    for (auto val : topic[colors[i]]) {
      int temp = 0;
      set<int> st2;
      for (auto num : graph[val]) {
        if (Arr[num] < colors[i]) {
          st2.insert(Arr[num]);
        }
        if (Arr[num] == colors[i]) {
          return false;
        }
      }
      if (st2.size() < i) return false;
    }
  }
  return true;
}
void initialize() {
  for (int i = 1; i <= n; i++) Arr[i] = i;
}
int main() {
  int x, y;
  cin >> n >> m;
  initialize();
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    graph[y].push_back(x);
    graph[x].push_back(y);
  }
  set<int> st;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    st.insert(x);
    topic[x].push_back(i);
    Arr[i] = x;
  }
  for (auto v : st) {
    colors.push_back(v);
  }
  if (!check())
    cout << -1 << endl;
  else {
    for (int i = 1; i <= n; i++) {
      for (auto val : topic[i]) {
        cout << val << " ";
      }
    }
  }
  return 0;
}
