#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > AdjList;
const int maxn = 5e5 + 5;
int t[maxn];
int ans[maxn];
bool dfs_num[maxn];
int proc[maxn];
bool cmp(int a, int b) { return t[a] < t[b]; }
int V, E;
signed main() {
  cin >> V >> E;
  AdjList.assign(V + 1, vector<int>());
  for (int i = 0; i < E; i++) {
    int u, v;
    cin >> u >> v;
    AdjList[u].push_back(v);
    AdjList[v].push_back(u);
  }
  for (int i = 1; i <= V; i++) {
    cin >> t[i];
    dfs_num[i] = 0;
    ans[i] = i;
    proc[i] = 1;
  }
  sort(ans + 1, ans + V + 1, cmp);
  for (int i = 1; i <= V; i++) {
    int tmp = ans[i];
    if (proc[tmp] != t[tmp]) {
      cout << -1;
      return 0;
    }
    dfs_num[tmp] = 1;
    for (int j = 0; j < AdjList[tmp].size(); j++) {
      int v = AdjList[tmp][j];
      if (dfs_num[v] == 0) {
        if (proc[v] < proc[tmp]) {
          cout << -1;
          return 0;
        } else
          proc[v] = max(proc[v], proc[tmp] + 1);
      }
    }
  }
  for (int i = 1; i <= V; i++) cout << ans[i] << " ";
}
