#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
vector<long long int> adj[500005], v[500005];
long long int t[500005];
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int f = 1;
  for (long long int i = 0; i < m; i++) {
    long long int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (long long int i = 1; i < n + 1; i++) {
    cin >> t[i];
    v[t[i]].push_back(i);
  }
  for (long long int i = 1; i < n + 1; i++) {
    set<long long int> s;
    for (auto node : adj[i]) {
      if (t[node] == t[i]) {
        f = 0;
        break;
      }
      if (t[i] > t[node]) s.insert(t[node]);
    }
    if ((long long int)s.size() != t[i] - 1) {
      f = 0;
      break;
    }
    if (f == 0) break;
  }
  if (f == 0) {
    cout << -1 << endl;
    return;
  }
  for (long long int i = 1; i < n + 1; i++) {
    if ((long long int)v[i].size() == 0) break;
    for (auto c : v[i]) cout << c << " ";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int test;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
