#include <bits/stdc++.h>
using namespace std;
long long int M = 998244353;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> nbrs[n + 1];
  vector<int> adj[n + 1];
  for (int i = 0; i < m; i++) {
    int aa, bb;
    cin >> aa >> bb;
    adj[aa].push_back(bb);
    adj[bb].push_back(aa);
  }
  vector<pair<int, int> > info(n);
  for (int i = 0; i < n; i++) {
    cin >> info[i].first;
    info[i].second = i + 1;
  }
  sort(info.begin(), info.end());
  int cc = 0;
  for (int i = 0; i < n; i++) {
    int col = info[i].first;
    int ind = info[i].second;
    if (nbrs[ind].size() != col - 1 ||
        (nbrs[ind].size() && *prev(nbrs[ind].end()) != col - 1)) {
      cc = 1;
      break;
    }
    for (int j = 0; j < adj[ind].size(); j++) {
      nbrs[adj[ind][j]].insert(col);
    }
  }
  if (cc) {
    cout << -1 << endl;
  } else {
    for (int i = 0; i < n; i++) cout << info[i].second << " ";
  }
  cout << endl;
  return 0;
}
