#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n, m;
int a[maxn];
vector<int> g[maxn];
vector<int> color[maxn];
int last[maxn];
vector<int> res;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    color[a[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    for (int at : color[i]) {
      for (int nei : g[at]) {
        last[a[nei]] = at;
      }
      int col = 1;
      while (last[col] == at) col++;
      if (col != a[at]) out(-1);
      res.push_back(at);
    }
  }
  assert(int(res.size()) == n);
  for (int x : res) cout << x << " ";
  cout << endl;
  return 0;
}
