#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
ifstream cinn("in.txt");
ofstream coutt("out.txt");
long long poww(const long long &a, long long b,
               const long long &m = (1000000007)) {
  if (b == 0) return 1;
  long long x = poww(a, b / 2, m);
  x = x * x % m;
  if (b & 1) x = x * a % m;
  return x;
}
long long ceil(const long long &a, const long long &b) {
  return (a - 1) / b + 1;
}
long long n, m;
vector<long long> adj[500005];
long long p[500005], vis[500005];
vector<long long> lola[500005];
void dfs(long long cur) {
  set<long long> st;
  for (long long ch : adj[cur]) {
    if (vis[ch] != 0) {
      st.insert(vis[ch]);
    }
  }
  vector<long long> lala = vector<long long>((st).begin(), (st).end());
  if (lala.empty()) {
    vis[cur] = 1;
    return;
  }
  if (lala[0] != 1) {
    vis[cur] = 1;
    return;
  }
  for (long long i = 0; i < lala.size() - 1; i++) {
    if (lala[i] + 1 != lala[i + 1]) {
      vis[cur] = lala[i] + 1;
      return;
    }
  }
  vis[cur] = lala.back() + 1;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (long long i = 1; i <= n; i++) {
    cin >> p[i];
    lola[p[i]].push_back(i);
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j : lola[i]) {
      dfs(j);
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j : lola[i]) {
      if (p[j] != vis[j]) {
        cout << -1;
        exit(0);
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j : lola[i]) {
      cout << j << " ";
    }
  }
}
