#include <bits/stdc++.h>
using namespace std;
const int N = 300009;
const int mod = 1000000007;
void pre() {}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin.exceptions(cin.failbit);
  ;
  pre();
  int n, m, a, b, num = 0;
  cin >> n >> m;
  vector<vector<int>> v(n + 1);
  for (int i = 0; i < (m); ++i)
    cin >> a >> b, v[a].push_back(b), v[b].push_back(a);
  vector<pair<int, int>> t(n), temp(n);
  for (auto& it : t) cin >> it.first, it.second = ++num;
  temp = t;
  sort(t.begin(), t.end());
  vector<int> ans, loc(n + 1);
  num = 0;
  for (auto& it : t) loc[it.second] = num++;
  for (int i = 0; i < (n); ++i) {
    ;
    set<int> less;
    for (auto& it : v[t[i].second]) {
      if (temp[it - 1].first == t[i].first) {
        cout << -1 << "\n";
        exit(0);
      } else if (temp[it - 1].first < t[i].first) {
        less.insert(temp[it - 1].first);
      }
    };
    if ((int)((less).size()) < (t[i].first - 1)) {
      cout << -1 << "\n";
      exit(0);
    }
    ans.push_back(t[i].second);
  }
  for (auto& it : ans) cout << it << " ";
  return 0;
}
