#include <bits/stdc++.h>
using namespace std;
long long int arr[2010000], mi[2010000], pl[2010000], total;
vector<long long int> adj[2010000], v[2010000];
long long int a[2010000];
long long int comp(long long int &x, long long int &y) { return a[x] < a[y]; }
int main() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < m; i++) {
    long long int p, q;
    cin >> p >> q;
    adj[p].push_back(q);
    adj[q].push_back(p);
  }
  for (long long int i = 1; i <= n; i++) cin >> arr[i];
  for (long long int i = 1; i <= n; i++) {
    v[arr[i]].push_back(i);
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < v[i].size(); j++) {
      a[v[i][j]] = i;
    }
    for (long long int j = 0; j < v[i].size(); j++) {
      sort(adj[v[i][j]].begin(), adj[v[i][j]].end(), comp);
      long long int coun = 1;
      for (long long int k = 0; k < adj[v[i][j]].size(); k++) {
        if (a[adj[v[i][j]][k]] == i) {
          cout << "-1\n";
          return 0;
        } else {
          if (k == 0) {
            ;
          } else {
            if (a[adj[v[i][j]][k - 1]] == a[adj[v[i][j]][k]]) {
              ;
            } else {
              coun++;
            }
          }
        }
      }
      if (adj[v[i][j]].size() == 0 && i > 1) {
        cout << "-1\n";
        return 0;
      } else if (adj[v[i][j]].size() == 0) {
      } else {
        if (a[adj[v[i][j]][0]] == 0) coun--;
        if (a[adj[v[i][j]][adj[v[i][j]].size() - 1]] == i - 1 &&
            coun == i - 1) {
        } else {
          cout << "-1\n";
          return 0;
        }
      }
    }
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < v[i].size(); j++) cout << v[i][j] << " ";
  }
}
