#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int c[maxn];
vector<int> g[maxn];
pair<int, int> rec[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0, a, b; i < m; i++) {
    cin >> a >> b;
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 0, t; i < n; i++) {
    cin >> t;
    rec[i] = {t, i};
  }
  sort(rec, rec + n);
  for (int i = 0; i < n; i++) {
    int node = rec[i].second;
    int col = rec[i].first;
    set<int> bs;
    for (int j : g[node]) {
      int ncol = c[j];
      if (ncol && ncol < col) bs.insert(ncol);
      if (ncol == col) {
        cout << -1 << endl;
        return 0;
      }
    }
    if (bs.size() == col - 1)
      c[node] = col;
    else {
      cout << -1 << "\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << rec[i].second + 1 << ' ';
  }
  cout << "\n";
}
