#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long fast(long long x, long long n) {
  long long ans = 1;
  for (; n; n >>= 1, x = x * x % mod)
    if (n & 1) ans = ans * x % mod;
  return ans;
}
const int N = 1e6 + 100;
struct node {
  int id, val;
} s[N];
vector<int> edge[N];
int maxx[N], ans[N];
int main() {
  int n, m;
  cin >> n >> m;
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i].val);
    s[i].id = i;
    maxx[i] = 1;
  }
  sort(s + 1, s + 1 + n, [&](node a, node b) { return a.val < b.val; });
  for (int i = 1; i <= n; i++) {
    if (maxx[s[i].id] != s[i].val) return printf("-1"), 0;
    for (auto v : edge[s[i].id])
      if (maxx[v] == s[i].val) maxx[v]++;
    ans[i] = s[i].id;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
