#include <bits/stdc++.h>
using namespace std;
vector<int> viz[500010];
vector<int> refe[500010];
int id[5000010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    viz[a].push_back(b);
    viz[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    cin >> id[i];
    refe[id[i]].push_back(i);
  }
  bool sera = true;
  vector<int> init(n + 1, 1);
  for (int i = 1; i <= n; i++) {
    for (auto j : refe[i]) {
      if (id[j] != init[j]) sera = false;
      for (auto k : viz[j]) {
        if (init[k] == init[j]) init[k]++;
      }
    }
  }
  if (sera) {
    for (int i = 1; i <= n; i++) {
      for (auto j : refe[i]) {
        cout << j << ' ';
      }
    }
    cout << endl;
  } else
    cout << -1 << endl;
}
