#include <bits/stdc++.h>
namespace ucp {
template <typename T>
void Min(T& a, T b) {
  if (a > b) a = b;
}
template <typename T>
void Max(T& a, T b) {
  if (a < b) a = b;
}
inline int read() {
  int sign, data = 0;
  char ch = 0;
  while ((ch != '-') && ch < '0' || ch > '9') ch = getchar();
  if (ch == '-') {
    sign = -1;
    ch = getchar();
  } else
    sign = 1;
  while (ch >= '0' && ch <= '9') {
    data = data * 10 + ch - '0';
    ch = getchar();
  }
  return data * sign;
}
}  // namespace ucp
using namespace std;
using namespace ucp;
const int mxint = 0x3f3f3f3f;
const long long mxll = 1e18;
const int lim = 1e5 + 10;
const int maxn = 5e5 + 10;
const long long mod = 998244353;
int n, m;
int h[maxn], tot, e[maxn * 2], ne[maxn * 2];
int c[maxn];
void add(int u, int v) { e[tot] = v, ne[tot] = h[u], h[u] = tot++; }
int main() {
  scanf("%d%d", &n, &m);
  memset(h, -1, sizeof h);
  tot = 0;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  vector<pair<int, int> > a;
  for (int i = 1; i <= n; i++) {
    int num = read();
    c[i] = num;
    a.push_back(make_pair(num, i));
  }
  sort(a.begin(), a.end());
  vector<int> ans;
  vector<int> res;
  ans.resize(n + 1);
  for (int i = 0; i < n; i++) {
    set<int> st;
    int u = a[i].second;
    for (int j = h[u]; ~j; j = ne[j]) {
      int v = e[j];
      st.insert(c[v]);
    }
    ans[u] = 1;
    while (st.find(ans[u]) != st.end()) ans[u]++;
    if (ans[u] != a[i].first) {
      puts("-1");
      return 0;
    }
    res.push_back(a[i].second);
  }
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  return 0;
}
