#include <bits/stdc++.h>
namespace std {
template <typename A, typename B>
inline string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
inline string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
inline string to_string(tuple<A, B, C, D> p);
inline string to_string(const string& s) { return '"' + s + '"'; }
inline string to_string(const char* s) { return to_string((string)s); }
inline string to_string(bool b) { return (b ? "true" : "false"); }
inline string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
inline 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>
inline 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>
inline string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
inline string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
inline string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
}  // namespace std
inline void debug_out() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
inline void debug_out(Head H, Tail... T) {
  std::cerr << " " << std::to_string(H);
  debug_out(T...);
}
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int>> e(n);
  for (int i = 0; i < m; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    e[v].push_back(u);
    e[u].push_back(v);
  }
  vector<pair<int, int>> color(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &color[i].first);
    color[i].first--;
    color[i].second = i;
    b[i] = color[i].first;
  }
  sort((color).begin(), (color).end());
  bool good = true;
  vector<int> use(n);
  for (int i = 0; i < n; i++) {
    int v = color[i].second;
    int tgt = color[i].first;
    vector<int> mask(tgt + 1);
    for (auto u : e[v]) {
      if (use[u]) {
        assert(b[u] <= tgt);
        mask[b[u]] = 1;
      }
    }
    for (int j = 0; j < tgt; j++) {
      if (mask[j] == 0) {
        good = false;
      }
    }
    if (mask[tgt]) {
      good = false;
    }
    use[v] = 1;
  }
  if (!good) {
    puts("-1");
    return 0;
  }
  for (auto x : color) {
    cout << x.second + 1 << " ";
  }
  cout << endl;
  return 0;
}
