#include <bits/stdc++.h>
using namespace std;
long long int n, m, cnt[1000006];
vector<long long int> G[1000006], ans;
bool solution = true;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long int a, b;
    scanf("%I64d %I64d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<pair<long long int, long long int> > vp;
  for (int i = 1; i <= n; i++) {
    long long int a;
    scanf("%I64d", &a);
    vp.push_back({a, i});
  }
  sort(vp.begin(), vp.end());
  for (int i = 0; i < vp.size(); i++) {
    long long int a = vp[i].first, u = vp[i].second;
    set<long long int> st;
    long long int mx = 0;
    for (int j = 0; j < G[u].size(); j++) {
      long long int v = G[u][j];
      if (cnt[v] != 0) {
        mx = max(cnt[v], mx);
        st.insert(cnt[v]);
      }
    }
    if (a == 1) {
      if (st.empty()) {
        cnt[u] = 1;
        ans.push_back(u);
      } else
        solution = false;
    } else {
      if (st.size() == a - 1 && mx == a - 1) {
        cnt[u] = a;
        ans.push_back(u);
      } else
        solution = false;
    }
  }
  if (!solution)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
