#include <bits/stdc++.h>
using namespace std;
long long t, n, m, u, v, q, k;
const int N = 1e6 + 500;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 57;
long long arr[N];
vector<int> adj[N];
vector<int> pos[N];
int val[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    pos[arr[i]].push_back(i);
  }
  int cur = 0;
  bool valid = true;
  vector<int> ord;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < pos[i].size(); ++j) {
      int idx = pos[i][j];
      int mn = 1;
      vector<int> neigh;
      for (int u : adj[idx]) neigh.push_back(val[u]);
      sort(neigh.begin(), neigh.end());
      for (int u : neigh)
        if (u == mn) ++mn;
      val[idx] = mn;
      if (val[idx] != arr[idx]) {
        valid = false;
        break;
      }
      ord.push_back(idx);
    }
  }
  if (!valid)
    cout << -1 << endl;
  else {
    for (int i = 0; i < ord.size(); ++i) cout << ord[i] << " ";
    cout << endl;
  }
}
