#include <bits/stdc++.h>
using namespace std;
vector<long long> v[500005];
long long vis[500005] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, i, j, k, x, y;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  vector<pair<long long, long long> > vct;
  for (i = 0; i < n; i++) {
    vct.push_back({a[i], i + 1});
  }
  sort((vct).begin(), (vct).end());
  vector<long long> ans;
  for (i = 0; i < n; i++) {
    long long node = vct[i].second;
    long long num = vct[i].first;
    set<long long> s;
    for (auto it : v[node]) {
      if (vis[it] != 0) {
        s.insert(vis[it]);
      }
    }
    if (s.size() == num - 1) {
      if (s.size()) {
        if (*s.rbegin() != num - 1) break;
      }
      ans.push_back(node);
      vis[node] = num;
    } else
      break;
  }
  if (i == n) {
    for (auto it : ans) {
      cout << it << " ";
    }
  } else
    cout << "-1" << endl;
}
