#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = acos(-1.0);
const double epsilon = PI / 180.0;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 5e5 + 10;
struct node {
  int a, b;
  bool operator<(const node e) const { return b < e.b; }
} f[N];
vector<int> g[N];
int t[N];
int vis[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; 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 + 1; i++) {
    scanf("%d", &t[i]);
    f[i].a = i;
    f[i].b = t[i];
  }
  int f1;
  sort(f + 1, f + n + 1);
  vector<int> ans;
  for (int i = 1; i < n + 1; i++) {
    int now = f[i].a;
    vis[now] = 1;
    ans.push_back(now);
    f1 = 0;
    int f2 = 0;
    set<int> s;
    for (int j = 0; j < g[now].size(); j++) {
      int v = g[now][j];
      if (vis[v]) f2 = 1, s.insert(t[v]);
      if (vis[v] == 1 && t[v] + 1 == t[now]) {
        f1 = 1;
        continue;
      }
      if (vis[v] == 1 && t[v] == t[now]) {
        f1 = 0;
        break;
      }
    }
    if (f2 == 0 && t[now] == 1) f1 = 1;
    if (f1 == 0) break;
    if (s.size() != t[now] - 1) {
      f1 = 0;
      break;
    }
  }
  if (f1 == 0)
    cout << "-1";
  else {
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  }
  return 0;
}
