#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
const int inf = 1e9;
vector<int> adj[MAX];
vector<int> top[MAX];
int p[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc, x, y, n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 0; i < (int)n; i++) {
    cin >> x;
    top[x].push_back(i + 1);
  }
  for (int i = 2; i < (int)n + 1; i++) {
    if (top[i].size() > 0 && top[i - 1].size() == 0) {
      cout << "-1\n";
      return 0;
    }
  }
  for (int i = 1; i < (int)n + 1; i++) {
    for (int j = 0; j < (int)top[i].size(); j++) {
      int u = top[i][j];
      set<int> aux;
      for (int k = 0; k < (int)adj[u].size(); k++) {
        int v = adj[u][k];
        aux.insert(p[v]);
      }
      int ind = 1;
      while (aux.count(ind) == 1) ind++;
      p[u] = ind;
      if (ind != i) {
        cout << "-1\n";
        return 0;
      }
    }
  }
  for (int i = 1; i < (int)n + 1; i++) {
    for (int j = 0; j < (int)top[i].size(); j++) {
      cout << top[i][j] << " ";
    }
  }
  cout << endl;
}
