#include <bits/stdc++.h>
using namespace std;
vector<int> graph[500001];
void solve() {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B;
    graph[A].push_back(B);
    graph[B].push_back(A);
  }
  vector<pair<int, int> > q;
  vector<int> color(N + 1);
  for (int i = 1; i <= N; i++) {
    int t;
    cin >> t;
    color[i] = t;
    q.push_back({t, i});
  }
  sort(begin(q), end(q));
  vector<int> order;
  for (pair<int, int> &x : q) {
    int t, i;
    tie(t, i) = x;
    vector<int> seen(t);
    for (int j : graph[i]) {
      if (color[j] == t) {
        cout << -1 << '\n';
        return;
      }
      if (color[j] < t) seen[color[j]] = 1;
    }
    for (int c = 1; c < t; c++) {
      if (!seen[c]) {
        cout << -1 << '\n';
        return;
      }
    }
    order.push_back(i);
  }
  for (int i : order) cout << i << " ";
  cout << '\n';
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  solve();
}
