#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m, c2;
  cin >> n >> m;
  bool check = 1;
  int a[m], b[m];
  vector<int> adj[n + 1];
  vector<int> c;
  vector<pair<int, int>> c1;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    adj[a[i]].push_back(b[i]);
    adj[b[i]].push_back(a[i]);
  }
  for (int i = 0; i < n; i++) {
    cin >> c2;
    c.push_back(c2);
    c1.push_back(make_pair(c2, i + 1));
  }
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() > 0) {
      vector<int> neighbor;
      for (int j = 0; j < adj[i].size(); j++)
        neighbor.push_back(c[adj[i][j] - 1]);
      for (int j = 1; j < c[i - 1]; j++) {
        if (find(neighbor.begin(), neighbor.end(), j) == neighbor.end()) {
          check = 0;
          break;
        }
      }
    } else if (c[i - 1] > 1)
      check = 0;
    if (check == 0) break;
  }
  for (int i = 0; i < m; i++) {
    if (c[a[i] - 1] == c[b[i] - 1]) {
      check = 0;
      break;
    }
  }
  if (check == 0)
    cout << "-1" << endl;
  else {
    sort(c1.begin(), c1.end());
    for (int i = 0; i < n; i++) cout << c1[i].second << " ";
    cout << endl;
  }
}
int main() {
  solve();
  return 0;
}
