#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
vector<int> g[N];
struct Node {
  int v, id;
} e[N];
int ans[N];
int mx[N];
bool cmp(Node a, Node b) {
  if (a.v != b.v) return a.v < b.v;
  return a.id < b.id;
}
signed main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &e[i].v);
    e[i].id = i;
  }
  sort(e + 1, e + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    int x = e[i].id;
    int val = e[i].v;
    if (mx[x] != val - 1) {
      puts("-1");
      return 0;
    }
    ans[i] = x;
    for (int v : g[x]) {
      if (mx[v] == val - 1) {
        mx[v] = val;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
