#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> g[n + 1];
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<pair<int, int>> cn;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cn.push_back(make_pair(a[i], i));
  }
  bool ok = true;
  for (int i = 1; i <= n; i++) {
    set<int> s;
    for (auto j : g[i]) {
      if (a[j] < a[i]) s.insert(a[j]);
      if (a[j] == a[i]) {
        ok = false;
        break;
      }
    }
    if (!ok or (int) s.size() != a[i] - 1) {
      ok = false;
      break;
    }
  }
  if (!ok)
    cout << "-1\n";
  else {
    sort(cn.begin(), cn.end());
    for (auto i : cn) cout << i.second << " ";
    cout << "\n";
  }
  return 0;
}
