#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  while (cin >> n) {
    cin >> m;
    vector<vector<int>> adj(n);
    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);
    }
    vector<pair<int, int>> tp(n);
    for (int i = 0; i < n; i++) {
      cin >> tp[i].first;
      tp[i].second = i;
    }
    sort(tp.begin(), tp.end());
    vector<set<int>> nt(n);
    vector<int> sm(n);
    bool ok = true;
    for (auto p : tp) {
      int t = p.first, b = p.second;
      auto fnd = nt[b].find(t);
      if (fnd != nt[b].end() || (1 + t - 1) * (t - 1) / 2 > sm[b]) {
        ok = false;
        break;
      } else {
        for (int u : adj[b]) {
          auto res = nt[u].insert(t);
          if (res.second) {
            sm[u] += t;
          }
        }
      }
    }
    if (ok) {
      int z = tp.size();
      for (int i = 0; i < z; i++) {
        cout << (i ? " " : "") << (tp[i].second + 1);
      }
      cout << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
