#include <bits/stdc++.h>
bool FLAG = 0;
using namespace std;
const long long MOD = 998244353, N = (long long)1e6 + 222;
const long long INF = (long long)1e18;
const long double eps = (long double)1e-6;
long long dx[] = {0, -1, 0, 1, 0};
long long dy[] = {0, 0, 1, 0, -1};
long long a[N], used[N], n, m, ok;
vector<long long> g[N];
set<long long> s;
pair<long long, long long> p[N];
inline void solve() {
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) s.insert(i);
  for (long long i = 1; i <= m; ++i) {
    long long l, r;
    cin >> l >> r;
    g[l].push_back(r);
    g[r].push_back(l);
  }
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; ++i) {
    for (auto to : g[i]) {
      s.erase(a[to]);
    }
    if ((*s.begin()) != a[i]) {
      ok = 1;
      break;
    }
    for (auto to : g[i]) {
      s.insert(a[to]);
    }
  }
  if (ok == 1) {
    cout << -1;
  } else {
    for (long long i = 1; i <= n; ++i) {
      p[i] = {a[i], i};
    }
    sort(p + 1, p + 1 + n);
    for (long long i = 1; i <= n; ++i) cout << p[i].second << " ";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
