#include <bits/stdc++.h>
const long long int md = 998244353LL;
using namespace std;
vector<long long int> adj[500005];
long long int col[500005];
long long int vis[500005];
void dfs(long long int node, long long int ch) {}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  vector<pair<long long int, long long int>> p;
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    p.push_back(make_pair(x, i));
    col[i] = x;
  }
  sort(p.begin(), p.end());
  long long int ff = 0;
  for (long long int i = 0; i < p.size(); i++) {
    long long int node = p[i].second;
    vis[node] = 1;
    long long int c = col[node];
    set<long long int> s;
    for (long long int j = 0; j < adj[node].size(); j++) {
      if (vis[adj[node][j]]) s.insert(col[adj[node][j]]);
      if (c == col[adj[node][j]]) {
        ff = 1;
        break;
      }
    }
    if (s.size() != c - 1) {
      ff = 1;
      break;
    }
  }
  if (ff == 1) {
    cout << -1 << endl;
  } else {
    for (long long int i = 0; i < p.size(); i++) {
      cout << p[i].second << " ";
    }
    cout << endl;
  }
}
