#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> adj(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<vector<int>> des(n + 1);
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    des[a].push_back(i);
  }
  vector<int> mina(n + 1, 1);
  for (int i = 1; i <= n; i++) {
    for (int& a : des[i]) {
      if (mina[a] != i) {
        cout << "-1" << endl;
        return;
      }
      for (int& b : adj[a]) {
        if (mina[b] == i) mina[b]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int& a : des[i]) {
      cout << a << ' ';
    }
  }
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
