#include <bits/stdc++.h>
using namespace std;
using ill = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
int mod(int a, int m) {
  a %= m;
  return a >= 0 ? a : a + m;
}
vector<vector<int>> gr;
vector<int> t;
vector<pair<int, int>> order;
vector<char> rdy;
int lookaround(int v) {
  unordered_set<int> neig;
  for (int n : gr[v]) {
    if (rdy[n]) {
      neig.insert(t[n]);
    }
  }
  for (int x = 1;; ++x) {
    if (neig.count(x) == 0) {
      return x;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  gr.resize(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  t.resize(n);
  order.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> t[i];
    order[i] = {t[i], i};
  }
  sort(begin(order), end(order));
  rdy.assign(n, false);
  for (int i = 0; i < n; ++i) {
    int v = order[i].second;
    int me = lookaround(v);
    if (me != t[v]) {
      cout << -1 << endl;
      return 0;
    }
    rdy[v] = true;
  }
  for (auto p : order) {
    cout << p.second + 1 << " ";
  }
  cout << endl;
}
