#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> ls[n];
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    ls[a].push_back(b);
    ls[b].push_back(a);
  }
  int t[n];
  for (int i = 0; i < n; i++) cin >> t[i];
  vector<pair<int, int> > ans;
  for (int i = 0; i < n; i++) ans.push_back(make_pair(t[i], i + 1));
  sort(ans.begin(), ans.end());
  bool flag = true;
  for (int i = 0; i < n; i++) {
    int u = ans[i].second - 1;
    set<int> s;
    for (int j = 0; j < ls[u].size(); j++) {
      if (t[ls[u][j]] == ans[i].first) {
        flag = false;
        break;
      } else if (t[ls[u][j]] < ans[i].first) {
        s.insert(t[ls[u][j]]);
      }
    }
    if (s.size() != (ans[i].first - 1)) {
      flag = false;
      break;
    }
    if (flag == false) break;
  }
  if (flag) {
    for (auto i : ans) cout << i.second << " ";
    cout << "\n";
  } else
    cout << -1 << "\n";
  return 0;
}
