#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
void solve() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<vector<int>> graph(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<pair<int, int>> t;
  for (int i = 1; i <= n; i++) {
    int cur;
    cin >> cur;
    t.push_back({cur, i});
  }
  sort(t.begin(), t.end(), [](pair<int, int> &left, pair<int, int> &right) {
    if (left.first == right.first) {
      return left.second < right.second;
    }
    return left.first < right.first;
  });
  vector<int> result;
  unordered_map<int, int> cur;
  for (int i = 0; i < t.size(); i++) {
    int node = t[i].second;
    int node_value = t[i].first;
    unordered_set<int> nexts;
    for (int next : graph[node]) {
      if (cur.find(next) != cur.end()) {
        nexts.insert(cur[next]);
      }
    }
    int possible = -1;
    for (int j = 1; j <= n; j++) {
      if (nexts.find(j) == nexts.end()) {
        possible = j;
        break;
      }
    }
    if (possible != -1 && possible != node_value) {
      cout << -1;
      return;
    }
    cur[node] = node_value;
    result.push_back(node);
  }
  for (int i = 0; i < result.size(); i++) {
    cout << result[i] << " ";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
