#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> adj(n);
  vector<pair<int, int>> want(n);
  vector<int> topic(n, 1);
  for (int i = (0); i < (m); i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = (0); i < (n); i++) {
    cin >> want[i].first;
    want[i].second = i;
  }
  sort((want).begin(), (want).end());
  for (int i = (0); i < (n); i++) {
    if (topic[want[i].second] == want[i].first) {
      for (int nbr : adj[want[i].second])
        if (topic[nbr] == want[i].first) topic[nbr]++;
    } else {
      cout << "-1\n";
      return 0;
    }
  }
  for (int i = (0); i < (n); i++) cout << want[i].second + 1 << ' ';
  cout << '\n';
}
