#include <bits/stdc++.h>
using namespace std;
vector<int> graph[500001];
int cont[500001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  vector<pair<long long, long long> > arr;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cont[i + 1] = x;
    arr.push_back({x, i + 1});
  }
  set<int> aux;
  for (int i = 1; i <= n; i++) {
    bool can = 1;
    for (int d = 0; d < graph[i].size(); d++) {
      if (cont[graph[i][d]] == cont[i]) {
        can = 0;
        break;
      } else if (cont[graph[i][d]] < cont[i]) {
        aux.insert(cont[graph[i][d]]);
      }
    }
    if (can == 0 || aux.size() != cont[i] - 1) {
      cout << "-1" << '\n';
      return 0;
    }
    aux.clear();
  }
  sort(arr.begin(), arr.end());
  for (int i = 0; i < n; i++) {
    cout << arr[i].second << " ";
  }
  return 0;
}
