#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
struct custom {
  bool operator()(const pair<long long int, long long int> &p1,
                  const pair<long long int, long long int> &p2) const {
    if (p1.first == p2.first) {
      return p1.second < p2.second;
    }
    return p1.first > p2.first;
  }
};
template <typename T>
inline void print(T x) {
  cout << x << "\n";
}
long long int get_pow(long long int x, long long int k) {
  if (k == 0) return 1ll;
  long long int y = get_pow(x, k / 2);
  y = (y * y) % MOD;
  if (k % 2) y = (y * x) % MOD;
  return y;
}
const int N = 5e5 + 5;
int n, m;
vector<vector<int>> v(N);
vector<pair<int, int>> b;
vector<int> val(N), res(N, 1);
vector<bool> used(N, false);
void solve() {
  cin >> n >> m;
  for (int i = (int)0; i < int(m); i++) {
    long long int x, y;
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = (int)0; i < int(n); i++) {
    long long int y;
    cin >> y;
    b.push_back({y, i});
    val[i] = y;
  }
  sort(b.begin(), b.end());
  for (int i = (int)0; i < int(n); i++) {
    long long int curr = b[i].first;
    if (res[b[i].second] != curr) {
      print(-1);
      return;
    }
    for (int x : v[b[i].second]) {
      if (!used[x]) {
        if (res[x] == curr) res[x]++;
      }
    }
    used[b[i].second] = true;
  }
  for (auto p : b) cout << p.second + 1 << ' ';
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  for (int tes = (int)0; tes < int(test); tes++) {
    solve();
  }
  return 0;
}
