#include <bits/stdc++.h>
using namespace std;
vector<int> mp[500005];
pair<int, int> t[500005];
int p[500005];
int main() {
  int n, m, a, b;
  bool f;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i].first);
    t[i].second = i;
  }
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) p[i] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < mp[t[i].second].size(); j++)
      if (p[mp[t[i].second][j]] == t[i].first) p[mp[t[i].second][j]]++;
  f = true;
  for (int i = 1; i <= n; i++)
    if (p[t[i].second] != t[i].first) f = false;
  if (!f)
    printf("-1\n");
  else {
    for (int i = 1; i <= n; i++)
      if (i != n)
        printf("%d ", t[i].second);
      else
        printf("%d\n", t[i].second);
  }
  return 0;
}
