#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = numeric_limits<long long>::max() / 4;
constexpr long long n_max = 5e5 + 10;
template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char c) { return to_string((string)&c); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) res += ", ";
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
vector<long long> topo_sort(vector<vector<long long>> &graph) {
  queue<long long> que;
  vector<long long> ans;
  long long v = graph.size();
  vector<long long> in(v);
  for (auto &vec : graph) {
    for (auto &to : vec) in[to]++;
  }
  for (long long i = 0; i < (long long)(v); i++)
    if (in[i] == 0) {
      que.emplace(i);
      ans.emplace_back(i);
    }
  while (!que.empty()) {
    auto f = que.front();
    que.pop();
    for (auto &to : graph[f]) {
      in[to]--;
      if (!in[to]) {
        ans.emplace_back(to);
        que.emplace(to);
      }
    }
  }
  return ans;
};
void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto &a : vec) {
    cout << a + 1;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto &vec : df) {
    print(vec);
  }
}
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> g(n);
  for (long long i = 0; i < (long long)(m); i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  vector<long long> t(n);
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> t[i];
    t[i]--;
  }
  vector<vector<long long>> graph(n), cnt(n_max);
  vector<long long> ans;
  for (long long i = 0; i < (long long)(n); i++) {
    cnt[t[i]].emplace_back(i);
  }
  for (long long i = 0; i < (long long)(n_max); i++) {
    if (cnt[i].size() == 0) break;
    for (auto &j : cnt[i]) {
      bool bs[t[j] + 1];
      fill(bs, bs + t[j] + 1, false);
      long long cnt = 0;
      for (auto &to : graph[j]) {
        if (bs[t[to]] == false) {
          bs[t[to]] = true;
          cnt++;
        }
      }
      42;
      if (cnt != t[j]) {
        cout << -1 << endl;
        return 0;
      }
      if (bs[t[j]]) {
        cout << -1 << endl;
        return 0;
      }
      ans.emplace_back(j);
      for (auto &to : g[j]) {
        graph[to].emplace_back(j);
      }
    }
  }
  if (ans.size() == n)
    print(ans);
  else {
    cout << -1 << endl;
  }
}
