#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 99;
int n, m, x, y, t, b[N], mark[N];
vector<int> g[N];
pair<int, int> a[N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    ;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &a[i].first);
    ;
    a[i].second = i;
    b[i] = a[i].first;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i < n + 1; i++) {
    int u = a[i].second;
    if (a[i].first > g[u].size() + 1) return cout << -1, 0;
    for (int j = 0; j < g[u].size(); j++) mark[b[g[u][j]]] = i;
    if (mark[a[i].first] == i) return cout << -1, 0;
    for (int j = 1; j < a[i].first; j++)
      if (mark[j] != i) return cout << -1, 0;
  }
  for (int i = 1; i < n + 1; i++) cout << a[i].second << " ";
}
