#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long int INF = 9e18 + 2e17;
const int inf = 2e9;
const double eps = 1e-10;
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > G = vector<vector<int> >(n + 1, vector<int>());
  vector<int> deg(n + 1, 0);
  vector<int> topic(n + 1, 0);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  vector<int> vis(n + 1, 0);
  map<int, vector<int> > topa;
  for (int i = 1; i < n + 1; ++i) {
    cin >> topic[i];
    topa[topic[i]].push_back(i);
  }
  int x = 1;
  vector<int> tos(n + 1, 0);
  vector<int> ans;
  for (auto i : topa) {
    if (i.first != x) {
      cout << -1 << endl;
      return 0;
    }
    for (int j : i.second) {
      set<int> ss;
      int kk = 1;
      for (int v : G[j]) ss.insert(tos[v]);
      for (int xx : ss)
        if (xx == 0)
          continue;
        else if (xx != kk)
          break;
        else
          kk++;
      if (kk != x) {
        cout << -1 << endl;
        return 0;
      }
      tos[j] = x;
      ans.push_back(j);
    }
    ++x;
  }
  for (int i : ans) cout << i << " ";
  cout << endl;
  return 0;
}
