#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
int N, M;
vector<vector<int> > adj;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N >> M;
  adj.clear();
  adj.resize(N + 1);
  for (__typeof__(M) m = (0) - ((0) > (M)); m != ((M) - ((0) > (M)));
       m += 1 - 2 * ((0) > (M))) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<int> colors(N + 1);
  vector<pair<int, int> > order(N);
  for (__typeof__(N + 1) i = (1) - ((1) > (N + 1));
       i != ((N + 1) - ((1) > (N + 1))); i += 1 - 2 * ((1) > (N + 1))) {
    cin >> colors[i];
    order[i - 1] = {colors[i], i};
  }
  sort((order).begin(), (order).end());
  bool ok = true;
  for (auto [col, n] : order) {
    vector<bool> marked(col);
    for (auto to : adj[n]) {
      if (colors[to] > col) continue;
      if (colors[to] == col) {
        ok = false;
        break;
      } else {
        marked[colors[to]] = true;
      }
    }
    for (__typeof__(col) i = (1) - ((1) > (col)); i != ((col) - ((1) > (col)));
         i += 1 - 2 * ((1) > (col)))
      if (!marked[i]) ok = false;
    if (!ok) break;
  }
  if (ok) {
    for (__typeof__(N) i = (0) - ((0) > (N)); i != ((N) - ((0) > (N)));
         i += 1 - 2 * ((0) > (N)))
      cout << order[i].second << " \n"[i == (N - 1)];
  } else {
    cout << "-1\n";
  }
  return 0;
}
