#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238462643383279502884197169399;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  while (tt--) {
    int n, m;
    cin >> n >> m;
    vector<int> g[n + 1];
    int a, b;
    for (int i = 0; i < m; ++i) {
      cin >> a >> b;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    vector<pair<int, int> > t(n);
    for (int i = 0; i < n; ++i) {
      cin >> t[i].first;
      t[i].second = i + 1;
    }
    sort(t.begin(), t.end());
    vector<int> top(n + 1, 0);
    vector<int> has(n + 1, 0);
    int mark = 1;
    vector<int> ans;
    for (pair<int, int>& p : t) {
      int curTop = p.first, blog = p.second;
      for (int& x : g[blog]) {
        has[top[x]] = mark;
      }
      if (has[curTop]) break;
      bool ok = 1;
      for (int i = 1; i < curTop; ++i) {
        if (has[i] != mark) {
          ok = 0;
          break;
        }
      }
      if (!ok) break;
      top[blog] = curTop;
      ans.push_back(blog);
      mark++;
    }
    if (ans.size() == n)
      for (int& x : ans) cout << x << " ";
    else
      cout << "-1";
  }
}
