#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vector<int>> edges(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  int t[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &t[i]);
    t[i]--;
  }
  vector<vector<int>> sorted(n);
  for (int i = 0; i < n; i++) sorted[t[i]].push_back(i);
  for (int i = 0; i < n; i++) {
    for (int a : sorted[i]) {
      vector<int> vs;
      for (int b : edges[a]) vs.push_back(t[b]);
      sort(vs.begin(), vs.end());
      int answer = 0;
      for (int v : vs) {
        if (v == i) {
          printf("-1");
          return 0;
        } else if (v == answer)
          answer++;
      }
      if (answer != i) {
        printf("-1");
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++)
    for (int a : sorted[i]) printf("%d ", a + 1);
}
