#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int n, m, u, v, vl[N];
pair<int, int> t[N];
vector<int> adj[N];
set<int> s;
set<int>::iterator it;
bool vld() {
  for (int i = 1; i <= n; i++) {
    if (vl[t[i].second] != t[i].first) return false;
  }
  return true;
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> t[i].first;
    t[i].second = i;
    vl[i] = 0;
  }
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) {
    u = t[i].second;
    s.clear();
    for (int j = 0; j < adj[u].size(); j++) {
      v = adj[u][j];
      if (vl[v] == 0) continue;
      s.insert(vl[v]);
    }
    int k = 1;
    for (it = s.begin(); it != s.end(); it++) {
      if (k != (*it)) {
        break;
      }
      k++;
    }
    vl[u] = k;
  }
  if (vld()) {
    for (int i = 1; i <= n; i++) {
      cout << t[i].second << " ";
    }
    cout << "\n";
  } else
    cout << "-1\n";
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
