#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, m, p[500005], av[500005];
vector<int> gr[500005], cn[500005], ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    av[i] = 1e9;
    cin >> p[i];
  }
  for (int i = 1; i <= n; i++) cn[p[i]].push_back(i);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < cn[i].size(); j++) {
      int x = cn[i][j];
      set<int> s;
      for (int z = 0; z < gr[x].size(); z++) {
        int u = gr[x][z];
        if (av[u] < p[x]) s.insert(av[u]);
        if (av[u] == p[x]) {
          cout << -1;
          return 0;
        }
      }
      if (s.size() == p[x] - 1) {
        av[x] = p[x];
        ans.push_back(x);
      } else {
        cout << -1;
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
}
