#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1000000ll;
vector<long long int> arr[maxn];
long long int color[maxn];
pair<long long int, long long int> a[maxn];
long long int visited[maxn];
int main() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    arr[x].push_back(y);
    arr[y].push_back(x);
  }
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    color[i] = x;
    a[i] = {color[i], i};
  }
  sort(a + 1, a + 1 + n);
  for (long long int i = 1; i <= n; i++) {
    long long int cnt = 0;
    for (auto it : arr[i]) {
      if (color[it] < color[i]) {
        if (visited[color[it]] == 0) cnt++;
        visited[color[it]] = 1;
      }
      if (color[it] == color[i]) cnt = INT_MAX;
    }
    if (cnt != color[i] - 1) {
      cout << -1 << endl;
      return 0;
    }
    for (auto it : arr[i]) visited[color[it]] = 0;
  }
  for (long long int i = 01; i <= n; i++) {
    cout << a[i].second << " ";
  }
  return 0;
}
