#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n + 1);
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  pair<int, int> ans[n];
  int a[n + 1];
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    ans[i - 1] = {a[i], i};
  }
  sort(ans, ans + n);
  for (int i = 1; i < n + 1; i++) {
    vector<bool> duh(a[i] + 1);
    for (auto e : g[i]) {
      if (a[e] <= a[i]) duh[a[e]] = true;
    }
    bool flag = !duh[a[i]];
    for (int j = 1; j < a[i]; j++)
      if (!duh[j]) flag = false;
    if (!flag) {
      for (int f : duh)
        cerr << "[(" << 32 << ") " << ("f") << "]: " << f << endl;
      ;
      cout << "-1\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i].second << " ";
  }
  cout << "\n";
}
