#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
const int K = 21;
int n, m, x, y;
vector<int> gr[N];
pair<int, int> A[N];
int can[N];
inline void test_case() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    cin >> x;
    A[i] = {x, i};
    can[i] = 1;
  }
  sort(A + 1, A + 1 + n);
  for (int i = 1; i <= n; i++) {
    int x = A[i].first;
    int ind = A[i].second;
    if (can[ind] != x) {
      cout << -1 << endl;
      return;
    }
    for (auto to : gr[ind]) {
      if (can[to] == x) {
        can[to]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << A[i].second << " ";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    test_case();
  }
}
