#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return ans;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > graph(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<int> inp(n + 1);
  queue<int> qq;
  for (int i = 0; i < n; i++) {
    cin >> inp[i + 1];
    if (inp[i + 1] == 1) qq.push(i + 1);
  }
  vector<int> ans;
  vector<int> visited(n + 1);
  vector<int> val(n + 1);
  int fl = 0;
  while (!qq.empty()) {
    int node = qq.front();
    qq.pop();
    if (visited[node]) continue;
    visited[node] = 1;
    ans.push_back(node);
    for (int i = 0; i < graph[node].size(); i++) {
      int nxt = graph[node][i];
      if (visited[nxt]) continue;
      if (inp[nxt] == inp[node]) {
        fl = 1;
        break;
      }
      if (val[nxt] == inp[node] - 1) val[nxt] = inp[node];
      if (inp[nxt] == val[nxt] + 1) {
        qq.push(nxt);
      }
    }
    if (fl) break;
  }
  if (fl) {
    cout << -1 << endl;
    return 0;
  }
  if (ans.size() == n) {
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  } else {
    cout << -1 << endl;
  }
}
