#include <bits/stdc++.h>
using namespace std;
int cansel_sync = (ios::sync_with_stdio(0), cin.tie(0), 0);
const int N = 500010;
const int inf = ~0u >> 2;
const long long INF = ~0ull >> 2;
long long read() {
  long long x;
  if (scanf("%lld", &x) == -1) exit(0);
  return x;
}
const double pi = acos(-1.0);
double readf() {
  double x;
  if (scanf("%lf", &x) == -1) exit(0);
  return x;
}
template <typename T>
T sqr(const T &x) {
  return x * x;
}
const int mod = (1 ? 1000000007 : 998244353);
long long mul(long long a, long long b, long long m = mod) { return a * b % m; }
long long qpow(long long a, long long b, long long m = mod) {
  long long ans = 1;
  for (; b; a = mul(a, a, m), b >>= 1)
    if (b & 1) ans = mul(ans, a, m);
  return ans;
}
long long getinv(long long v, long long m = mod) { return qpow(v, m - 2, m); }
vector<int> a[N];
struct node {
  int t, p;
} w[N];
int lab[N];
int n, m;
vector<int> v;
int mex(int x) {
  v.clear();
  for (auto p : a[x])
    if (lab[p]) v.push_back(lab[p]);
  sort(v.begin(), v.end());
  unique(v.begin(), v.end());
  for (int i = (0), _ = (v.size()); i < _; i++)
    if (v[i] != i + 1) return i + 1;
  return v.size() + 1;
}
signed main() {
  cin >> n >> m;
  while (m--) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  for (int i = (0), _ = (n); i < _; i++) {
    cin >> w[i].t;
    w[i].p = i + 1;
  }
  sort(w, w + n, [](node a, node b) { return a.t < b.t; });
  for (int i = (0), _ = (n); i < _; i++) {
    int t = mex(w[i].p);
    if (t != w[i].t) cout << -1 << endl, exit(0);
    lab[w[i].p] = w[i].t;
  }
  for (int i = (0), _ = (n); i < _; i++) cout << w[i].p << ' ';
  return 0;
}
