#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
vector<long long> g[maxn];
struct P {
  long long val, id;
  friend bool operator<(struct P a, struct P b) { return a.val < b.val; }
} a[maxn];
long long ans[maxn], col[maxn];
int main(void) {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) cin >> a[i].val, a[i].id = i;
  sort(a + 1, a + 1 + n);
  long long cnt = 0;
  for (long long i = 1; i <= n; i++) {
    long long u = a[i].id;
    long long val = a[i].val;
    col[u] = val;
    ans[++cnt] = u;
    multiset<long long> s;
    for (long long j = 0; j < g[u].size(); j++) {
      long long v = g[u][j];
      if (col[v]) s.insert(col[v]);
    }
    if (s.count(val)) {
      cout << "-1"
           << "\n";
      return 0;
    }
    for (long long k = 1; k < val; k++) {
      if (!s.count(k)) {
        cout << "-1"
             << "\n";
        return 0;
      }
    }
  }
  for (long long i = 1; i <= cnt; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
