#include <bits/stdc++.h>
using namespace std;
vector<int> adj[500001];
bool visited[500001];
bool possible = true;
unordered_map<int, int> mp;
void dfs(int i) {
  visited[i] = true;
  set<int> s;
  for (auto it : adj[i]) {
    s.insert(mp[it]);
    if (!visited[it]) {
      dfs(it);
    }
  }
  int sm = 0;
  for (auto it : s) {
    if (it == sm) {
      sm++;
    }
  }
  if (mp.find(i) != mp.end()) {
    if (mp[i] != sm) {
      possible = false;
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  pair<int, int> p[n];
  for (int i = 0; i < n; i++) {
    int tp;
    cin >> tp;
    tp--;
    p[i] = {tp, i};
    mp[i] = tp;
  }
  sort(p, p + n);
  vector<int> ans;
  for (auto it : p) {
    if (!visited[it.second]) {
      dfs(it.second);
      if (!possible) {
        printf("%d", -1);
        break;
      }
    }
    ans.push_back(it.second + 1);
  }
  if (ans.size() == n) {
    for (auto it : ans) {
      printf("%d ", it);
    }
  }
  return 0;
}
