#include <bits/stdc++.h>
using namespace std;
vector<int> E[1 << 19];
void solve(int test) {
  int n, m;
  cin >> n >> m;
  int i;
  for (i = (0); i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  vector<pair<int, int> > v(n);
  for (i = (0); i < (n); ++i) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort((v).begin(), (v).end());
  vector<int> next(n, 1);
  vector<int> res(n, -1);
  for (i = (0); i < (n); ++i) {
    int a = v[i].second;
    if (next[a] != v[i].first) {
      cout << (-1) << endl;
      return;
    }
    res[a] = next[a];
    for (int b : E[a])
      if (res[b] == -1 && next[b] == next[a]) ++next[b];
  }
  for (i = (0); i < (n); ++i) {
    int a = v[i].second;
    cout << (a + 1) << ' ';
  }
}
int main() {
  int T = 1, t;
  for (t = (0); t < (T); ++t) solve(t);
  return 0;
}
