#include <bits/stdc++.h>
using namespace std;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long _a, long long _b) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long int n, m;
void solve() {
  cin >> n >> m;
  vector<vector<int> > v(n + 1);
  for (auto i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<int> x(n + 1);
  for (auto i = 1; i < n + 1; i++) {
    cin >> x[i];
  }
  for (auto i = 1; i < n + 1; i++) {
    set<int> st;
    for (auto j = 0; j < v[i].size(); j++) {
      long long int b = v[i][j];
      long long int a = x[b];
      long long int c = x[i];
      if (a == c) {
        cout << -1 << endl;
        return;
      } else if (a >= 1 && a < c) {
        st.insert(a);
      }
    }
    if (st.size() != x[i] - 1) {
      cout << -1 << endl;
      return;
    }
  }
  vector<pair<int, int> > val;
  for (auto i = 1; i < n + 1; i++) val.push_back({x[i], i});
  sort(val.begin(), val.end());
  for (auto i = 0; i < val.size(); i++) cout << val[i].second << " ";
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
