#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, m;
int t[N];
vector<int> des[N];
vector<int> answer;
vector<int> adj[N];
int used[N];
bool cmp(int a, int b) { return t[a] < t[b]; }
void no() {
  cout << -1 << "\n";
  exit(0);
}
void check() {
  for (int u : answer) {
    if (t[u] == 1) continue;
    int cnt = 1;
    for (int j = 1; j < adj[u].size(); j++) {
      int y = adj[u][j];
      if (t[y] != t[adj[u][j - 1]] && t[y] < t[u]) cnt++;
    }
    if (cnt != t[u] - 1) {
      assert(false);
      cout << "Wrong answer\n";
      return;
    }
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    des[t[i]].push_back(i);
  }
  for (int x = 1; x <= n; x++) {
    sort(adj[x].begin(), adj[x].end(), cmp);
  }
  for (int i = 1; i <= n; i++) {
    for (int x : des[i]) {
      if (adj[x].size() == 0) {
        if (t[x] != 1) {
          no();
        } else {
          answer.push_back(x);
          continue;
        }
      }
      if (i == 1) {
        for (int y : adj[x]) {
          if (t[y] == 1) no();
        }
        answer.push_back(x);
        continue;
      }
      int cnt = 1;
      for (int j = 1; j < adj[x].size(); j++) {
        int y = adj[x][j];
        if (t[y] != t[adj[x][j - 1]] && t[y] < t[x]) cnt++;
        if (t[y] == t[x]) no();
      }
      if (cnt != t[x] - 1) {
        no();
      }
      answer.push_back(x);
    }
  }
  check();
  for (int i = 0; i < answer.size(); i++) cout << answer[i] << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
