#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6, INF = 1e9;
vector<int> G[N], v[N];
int a[N], cnt[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1, iend = m; i <= iend; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v), G[v].push_back(u);
  }
  for (int i = 1, iend = n; i <= iend; ++i)
    scanf("%d", &a[i]), v[a[i]].push_back(i);
  for (int i = 1, iend = n; i <= iend; ++i) {
    for (int j = 0, jend = G[i].size(); j < jend; ++j) ++cnt[a[G[i][j]]];
    if (cnt[a[i]]) {
      cout << -1 << endl;
      return 0;
    }
    for (int j = 1, jend = a[i] - 1; j <= jend; ++j)
      if (!cnt[j]) {
        cout << -1 << endl;
        return 0;
      }
    for (int j = 0, jend = G[i].size(); j < jend; ++j) --cnt[a[G[i][j]]];
  }
  for (int i = 1, iend = n; i <= iend; ++i)
    for (int j = 0, jend = v[i].size(); j < jend; ++j) printf("%d ", v[i][j]);
  return 0;
}
