#include <bits/stdc++.h>
using namespace std;
int flag;
vector<int> v[500005];
vector<int> w;
int vis[500005] = {0};
void dfs(int node) {
  vis[node] = 1;
  for (int i = 0; i < v[node].size(); i++) {
    if (vis[v[node][i]] != 1) {
      if (w[v[node][i]] == w[node]) {
        flag = 1;
      }
      dfs(v[node][i]);
    } else {
      if (w[v[node][i]] == w[node]) {
        flag = 1;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, a, b;
  vector<int> ans;
  vector<pair<int, int>> mp;
  pair<int, int> p;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  w.push_back(0);
  for (int i = 1; i <= n; i++) {
    cin >> a;
    w.push_back(a);
    p.first = a;
    p.second = i;
    mp.push_back(p);
  }
  dfs(1);
  sort(mp.begin(), mp.end());
  int freq[n + 5];
  for (int i = 0; i <= n; i++) {
    freq[i] = 1;
  }
  for (int i = 0; i < mp.size(); i++) {
    p = mp[i];
    if (freq[p.second] == p.first && v[p.second].size() >= (p.first - 1)) {
      ans.push_back(p.second);
      for (int j = 0; j < v[p.second].size(); j++) {
        if (freq[v[p.second][j]] == p.first) {
          freq[v[p.second][j]] = p.first + 1;
        }
      }
    } else {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    cout << "-1";
  } else {
    for (int j = 0; j < ans.size(); j++) {
      cout << ans[j] << " ";
    }
  }
}
