#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int n, m;
int de[maxn];
struct relationship {
  int blog, topic;
} re[maxn];
bool cmp(relationship &a, relationship &b) {
  if (a.topic < b.topic) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  vector<int> g[n + 1];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> re[i].topic;
    re[i].blog = i;
  }
  sort(re + 1, re + n + 1, cmp);
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    int blog = re[i].blog, topic = re[i].topic;
    int nb = g[blog].size();
    vector<int> use(nb + 1, 0);
    if (nb) {
      for (auto u : g[blog])
        if (de[u] <= nb) use[de[u]] = 1;
    }
    int res = nb + 1;
    for (int i = 0; i < nb; i++)
      if (!use[i + 1]) {
        res = i + 1;
        break;
      }
    if (res != topic) {
      cout << -1 << endl;
      return 0;
    }
    de[blog] = res;
    ans.emplace_back(blog);
  }
  for (auto u : ans) cout << u << " ";
  cout << endl;
  return 0;
}
