#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const int dir[2][4] = {{1, -1, 0, 0}, {0, 0, -1, 1}};
const long long mod = 998244353;
struct Node {
  int val, id;
} su[N];
bool cmp(const Node &a, const Node &b) { return a.val < b.val; }
vector<int> g[N];
int sett[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) sett[i] = 1;
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &su[i].val), su[i].id = i;
  sort(su + 1, su + n + 1, cmp);
  bool flag = 0;
  for (int i = 1; i <= n; i++) {
    int &id = su[i].id;
    int &val = su[i].val;
    if (sett[id] != val) {
      flag = 1;
      break;
    }
    for (int j = 0; j < g[id].size(); j++) {
      if (sett[g[id][j]] == val) sett[g[id][j]]++;
    }
  }
  if (flag)
    puts("-1");
  else {
    for (int i = 1; i <= n; i++) printf("%d ", su[i].id);
    puts("");
  }
  return 0;
}
