#include <bits/stdc++.h>
using namespace std;
int n, m, dp[500005], arr[500005];
vector<pair<int, int>> ans;
vector<int> d[500005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    d[u].push_back(v);
    d[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    ans.push_back(make_pair(arr[i], i));
  }
  sort(ans.begin(), ans.end());
  for (int i = 1; i <= n; i++) dp[i] = 1;
  int f = 0;
  for (int i = 0; i < n; i++) {
    int ps, vl;
    ps = ans[i].second;
    vl = ans[i].first;
    if (dp[ps] != vl) {
      f = 1;
      break;
    }
    for (auto j : d[ps]) {
      if (dp[j] == vl) dp[j]++;
    }
    if (f) break;
  }
  if (f)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      cout << ans[i].second << " ";
    }
  }
  return 0;
}
