#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long double PI = acos(-1);
const long long MOD = 1000000007;
const long long FMOD = 998244353;
const long double eps = 1e-9;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
vector<long long> v[500005], vec[500005];
long long a[500005], mn[500005];
long long n, m;
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    vec[a[i]].push_back(i);
    mn[i] = 1;
  }
  vector<long long> p;
  for (long long i = 1; i <= n; i++) {
    for (auto x : vec[i]) {
      if (mn[x] != i) {
        cout << -1;
        return 0;
      }
      p.push_back(x);
      for (auto u : v[x])
        if (mn[u] == i) mn[u]++;
    }
  }
  for (auto x : p) cout << x << ' ';
}
