#include <bits/stdc++.h>
using namespace std;
using uid = uniform_int_distribution<int>;
mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());
int rand(int a, int b) { return uid(a, b)(rng); }
void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long mod = 998244353;
int tablica[2];
long long potega(long long base, long long pot) {
  if (pot == 1) return base;
  if (pot % 2 == 0) {
    long long res = potega(base, pot / 2);
    return ((res * res) % mod);
  } else
    return ((potega(base, pot - 1) * base) % mod);
}
int bs(int pocz, int kon, int szu) {
  int sr;
  while (pocz < kon) {
    sr = (pocz + kon) / 2;
    if (tablica[sr] >= szu)
      kon = sr;
    else
      pocz = sr + 1;
  }
  return pocz;
}
int n, m, a, b, war, poz, p[5000007];
pair<int, int> t[500007], para;
vector<int> v[500007], zaj[500007];
void reset_arrays() {}
void solve() {
  reset_arrays();
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &war);
    t[i] = make_pair(war, i);
  }
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) {
    para = t[i];
    war = para.first;
    poz = para.second;
    sort(zaj[poz].begin(), zaj[poz].end());
    if (zaj[poz].size() == 0) {
      if (war != 1) {
        printf("-1\n");
        return;
      }
      p[i] = poz;
    } else {
      int z = zaj[poz][0];
      if (z != 1) {
        printf("-1\n");
        return;
      }
      int kt = 1, czy = 0;
      while (czy == 0 && kt < zaj[poz].size()) {
        if (zaj[poz][kt] > z + 1) {
          war = z + 1;
          czy = 1;
        }
        z = zaj[poz][kt];
        kt++;
      }
      if (czy == 0) war = z + 1;
      if (war != para.first) {
        printf("-1\n");
        return;
      }
      p[i] = poz;
    }
    for (int j = 0; j < v[poz].size(); j++) {
      int kt = v[poz][j];
      zaj[kt].push_back(war);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
