#include <bits/stdc++.h>
using namespace std;
bool check(long long n, long long pos) { return n & (1LL << pos); }
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
vector<long long> g[500005];
vector<long long> t[500005];
vector<long long> order;
long long vis[500005];
void clr(long long n) {
  order.clear();
  for (long long i = 0; i <= (n + 2); i++) {
    vis[i] = 0;
    g[i].clear();
    t[i].clear();
  }
}
bool imposs(long long node, long long num) {
  set<long long> st;
  for (auto it : g[node]) {
    if (vis[it]) st.insert(vis[it]);
    if (vis[it] == num) return 1;
  }
  if (st.size() != (num - 1)) return 1;
  vis[node] = num;
  return 0;
}
bool solve(long long n) {
  for (long long i = 1; i <= n; i++) {
    for (auto it : t[i]) {
      if (imposs(it, i)) return 0;
      order.push_back(it);
    }
  }
  return 1;
}
int main() {
  long long i, j, k, l, m, n, o, r, q;
  long long testcase;
  long long input, flag, tag, ans;
  while (cin >> n >> m) {
    clr(n);
    for (long long i = 1; i <= m; i++) {
      long long u, v;
      scanf("%lld", &u);
      scanf("%lld", &v);
      g[u].push_back(v);
      g[v].push_back(u);
    }
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &input);
      t[input].push_back(i);
    }
    if (solve(n) == 0)
      printf("-1");
    else {
      for (auto it : order) cout << it << " ";
      cout << '\n';
    }
  }
}
