#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > gr(n + 1);
  vector<pair<long long, long long> > vp(n);
  for (int i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  vector<long long> color(n + 1), vis(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> vp[i].first;
    vp[i].second = i + 1;
    color[i + 1] = vp[i].first;
  }
  sort(vp.begin(), vp.end());
  for (int i = 0; i < n; ++i) {
    long long cur = vp[i].first;
    for (int j = 1; j <= cur; j++) vis[j] = 0;
    for (auto j : gr[vp[i].second]) vis[color[j]] = 1;
    for (int j = 1; j < cur; j++)
      if (!vis[j]) {
        cout << "-1\n";
        return 0;
      }
    if (vis[cur]) {
      cout << "-1\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) cout << vp[i].second << " ";
  cout << "\n";
  return 0;
}
