#include <bits/stdc++.h>
using namespace std;
int n, m, pd[500005];
vector<int> e[500005];
struct order {
  int num, w;
  bool operator<(const order &v) const { return w < v.w; }
} c[500005];
inline int read() {
  int x = 0;
  register char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
  return x;
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    e[u].push_back(v), e[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) c[i].w = read(), c[i].num = i;
  for (int i = 1; i <= n; i++) {
    map<int, int> mp;
    vector<int>::iterator it;
    for (it = e[i].begin(); it != e[i].end(); ++it) mp[c[*it].w] = 1;
    for (int j = 1; j < c[i].w; j++)
      if (!mp[j]) {
        puts("-1");
        return 0;
      }
    if (mp[c[i].w]) {
      puts("-1");
      return 0;
    }
  }
  sort(c + 1, c + n + 1);
  for (int i = 1; i <= n; i++) printf("%d ", c[i].num);
  return 0;
}
