#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, m;
int t[500005];
int ind[500005], inv[500005];
int p[500005];
vector<vector<int> > adj;
void no() {
  cout << -1 << '\n';
  exit(0);
}
bool comp(int i, int j) { return t[i] < t[j]; }
void solve() {
  cin >> n >> m;
  adj.resize(n);
  for (long long i = (long long)0; i != (long long)m; i = i + 1) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long i = (long long)0; i != (long long)n; i = i + 1) cin >> t[i];
  ;
  iota(ind, ind + n, 0);
  sort(ind, ind + n, comp);
  for (long long i = (long long)0; i != (long long)n; i = i + 1) {
    inv[ind[i]] = i;
  }
  memset(p, 0, sizeof(p));
  for (long long i = (long long)0; i != (long long)n; i = i + 1) {
    if (p[i] != t[ind[i]] - 1) {
      no();
    }
    for (auto x : adj[ind[i]]) {
      if (p[inv[x]] == t[ind[i]] - 1) p[inv[x]] = t[ind[i]];
    }
  }
  for (long long i = (long long)0; i != (long long)n; i = i + 1) {
    cout << ind[i] + 1 << " ";
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
