#include <bits/stdc++.h>
using namespace std;
vector<long long> v[500005];
vector<long long> v1[500005];
long long arr[500005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
      long long a, b;
      cin >> a >> b;
      v[a].push_back(b);
      v[b].push_back(a);
    }
    unordered_map<long long, long long> make_pair;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      v1[arr[i]].push_back(i + 1);
    }
    bool ab = true;
    vector<long long> ans;
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < v1[i].size(); j++) {
        long long x = 1;
        set<long long> s;
        for (int l = 0; l < v[v1[i][j]].size(); l++) {
          if (make_pair.count(v[v1[i][j]][l])) {
            s.insert(make_pair[v[v1[i][j]][l]]);
          }
        }
        while (s.find(x) != s.end()) {
          x++;
        }
        if (x != i) {
          ab = false;
          break;
        }
        make_pair[v1[i][j]] = i;
        ans.push_back(v1[i][j]);
      }
      if (!ab) {
        break;
      }
    }
    if (ab) {
      for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";
      }
    } else {
      cout << -1;
    }
  }
  return 0;
}
