#include <bits/stdc++.h>
using namespace std;
const int maxn = 500009;
const int MOD = 1e9 + 7;
int a[maxn], idx[maxn];
vector<int> V[maxn];
int main() {
  ;
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    V[u].push_back(v);
    V[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    set<int> Se;
    for (int j : V[i]) {
      if (a[j] == a[i]) {
        cout << -1;
        return 0;
      } else if (a[j] < a[i])
        Se.insert(a[j]);
    }
    if (((int)(Se).size()) + 1 != a[i]) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) idx[i] = i;
  sort(idx + 1, idx + 1 + n, [](int x, int y) { return a[x] < a[y]; });
  for (int i = 1; i <= n; ++i) {
    cout << idx[i] << " ";
  }
  return 0;
}
