#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> g[n];
  vector<pair<int, int>> top;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int val[n];
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    val[i] = -1;
    top.push_back({a, i});
  }
  sort(top.begin(), top.end());
  for (int i = 0; i < n; i++) {
    int idx = top[i].first;
    int a = top[i].second;
    bool mark[idx];
    for (int i = 0; i < idx; i++) {
      mark[i] = 0;
    }
    for (int j = 0; j < g[a].size(); j++) {
      if (val[g[a][j]] == idx) {
        cout << -1;
        return 0;
      }
      if (val[g[a][j]] > 0) mark[val[g[a][j]]] = 1;
    }
    for (int i = 1; i < idx; i++) {
      if (!mark[i]) {
        cout << -1;
        return 0;
      }
    }
    val[a] = idx;
  }
  for (int i = 0; i < n; i++) {
    cout << top[i].second + 1 << " ";
  }
}
