#include <bits/stdc++.h>
using namespace std;
long long N = 1000000007;
int inf = INT_MAX;
long long pw(long long a, long long b) {
  if (b == 0) return 1;
  long long ans = pw(a, b / 2);
  ans = (ans * ans);
  if (b % 2) ans = (ans * a);
  return ans;
}
map<int, vector<int>> mp;
bool is(pair<int, int>* arr) {
  int sl;
  for (auto i : mp) {
    set<int> s;
    for (auto j : i.second) s.insert(arr[j].first);
    if (arr[i.first].first > s.size() + 1) return false;
    sl = 1;
    for (auto j : s) {
      if (s.count(sl) != 0)
        sl++;
      else
        break;
    }
    if (arr[i.first].first != sl) return false;
  }
  return true;
}
void solve() {
  int n, k;
  cin >> n >> k;
  int a, b;
  for (int i = 0; i < k; i++) {
    cin >> a >> b;
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  for (int i = 1; i < n + 1; i++) mp[i];
  pair<int, int> arr[n + 1];
  for (int i = 1; i < n + 1; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
  }
  if (!is(arr)) {
    cout << -1 << "\n";
    return;
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i < n + 1; i++) cout << arr[i].second << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
