#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5;
vector<int> edge[MAXN + 5];
unordered_map<int, bool> vis;
int val[MAXN + 5];
bool valid(int n) {
  for (int i = 1; i <= n; i++) {
    vis.clear();
    for (unsigned j = 0; j < edge[i].size(); j++) vis[val[edge[i][j]]] = 1;
    for (int j = 1; j < val[i]; j++)
      if (!vis[j]) return false;
    if (vis[val[i]]) return false;
  }
  return true;
}
int main(void) {
  int n, m, u, v;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) scanf("%d", val + i);
  if (!valid(n))
    puts("-1");
  else {
    vector<pair<int, int>> vec;
    for (int i = 1; i <= n; i++) vec.push_back(make_pair(val[i], i));
    sort(vec.begin(), vec.end());
    for (int i = 0; i < n; i++) printf("%d ", vec[i].second);
    putchar('\n');
  }
  return 0;
}
