#include <bits/stdc++.h>
using namespace std;
long long n, m, i, x, y, a[500010], t[500010];
pair<long long, long long> p[500010];
vector<long long> adj[500010];
bool vis[500010];
signed main() {
  cin >> n >> m;
  for (i = 1; i < m + 1; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (i = 1; i < n + 1; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p + 1, p + n + 1);
  for (i = 1; i < n + 1; i++) a[i] = 0;
  for (i = 1; i < n + 1; i++) {
    y = 0;
    for (long long u : adj[p[i].second]) y++, t[y] = a[u];
    sort(t + 1, t + y + 1);
    t[y + 1] = 1e9;
    x = 1;
    y = 1;
    while (t[y] == 0) y++;
    while (x >= t[y]) {
      if (x == t[y]) x++;
      y++;
    }
    if (x != p[i].first) {
      cout << -1;
      return 0;
    }
    a[p[i].second] = x;
  }
  for (i = 1; i < n + 1; i++) cout << p[i].second << " ";
}
