#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
vector<int> adj[N];
int col[N];
int truecol[N];
bool cmp(int a, int b) { return col[a] < col[b]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    cin >> col[i];
  }
  vector<int> nodos;
  for (int i = 0; i < n; i++) {
    nodos.push_back(i);
  }
  sort(begin(nodos), end(nodos), cmp);
  bool can = 1;
  for (int i = 0; i < n; i++) {
    int mini = -1;
    set<int> s;
    for (auto v : adj[nodos[i]]) {
      if (truecol[v] != 0) s.insert(truecol[v]);
    }
    int cnt = 1;
    s.insert(5000000);
    for (auto e : s) {
      if (cnt != e) {
        mini = cnt;
        break;
      }
      cnt++;
    }
    if (mini != col[nodos[i]]) can = 0;
    truecol[nodos[i]] = mini;
  }
  if (!can) {
    cout << -1 << "\n";
    return 0;
  } else {
    for (auto u : nodos) cout << u + 1 << " ";
  }
  cout << "\n";
  return 0;
}
