#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
pair<int, int> d[N];
vector<int> mp[N];
bool vist[N];
int vis[N];
int n, m, D[N], ans[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &d[i].first);
    d[i].second = i;
    D[i] = d[i].first;
  }
  for (int i = 1; i <= n; ++i) {
    vis[i] = 1;
  }
  sort(d + 1, d + n + 1);
  for (int i = 1; i <= n; ++i) {
    int now = d[i].second, longn = mp[now].size();
    ans[i] = now;
    vist[now] = 1;
    if (d[i].first != vis[now]) {
      puts("-1");
      return 0;
    }
    for (int j = 0; j < longn; ++j) {
      int to = mp[now][j];
      if (vist[to]) continue;
      if (vis[to] == vis[now]) vis[to]++;
      if (vis[to] != vis[now] + 1) {
        puts("-1");
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", ans[i]);
  }
  return 0;
}
