#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 5e5 + 100;
vector<int> node[N], pos[N], ans;
int a[N], n, m;
bool vis[N];
bool book[N];
bool check(int pos, int id) {
  for (int i = 1; i < pos; i++)
    if (!vis[i]) return false;
  return !vis[pos];
}
bool solve() {
  for (int i = 1; i <= n; i++)
    for (auto u : pos[i]) {
      for (auto v : node[u])
        if (book[v]) vis[a[v]] = true;
      if (check(i, i)) {
        ans.push_back(u);
        book[u] = true;
      } else
        return false;
      for (auto v : node[u])
        if (book[v]) vis[a[v]] = false;
    }
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    node[u].push_back(v);
    node[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    pos[a[i]].push_back(i);
  }
  if (!solve()) return 0 * puts("-1");
  for (auto v : ans) printf("%d ", v);
  return 0;
}
