#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> graph[500005];
int desired[500005];
vector<int> order;
int mex[500005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int tint1, tint2;
    cin >> tint1 >> tint2;
    tint1--;
    tint2--;
    graph[tint1].push_back(tint2);
    graph[tint2].push_back(tint1);
  }
  for (int i = 0; i < n; i++) {
    int tint1;
    cin >> tint1;
    tint1--;
    desired[i] = tint1;
    order.push_back(i);
  }
  sort(order.begin(), order.end(),
       [](int a, int b) { return desired[a] < desired[b]; });
  for (int i = 0; i < n; i++) {
    int v = order[i];
    if (mex[v] != desired[v]) {
      cout << "-1\n";
      return 0;
    }
    for (auto w : graph[v])
      if (mex[w] == desired[v]) mex[w]++;
  }
  for (auto k : order) cout << k + 1 << ' ';
  return 0;
}
