#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int maxn = 5e5 + 5;
int n, m;
vector<int> e[maxn];
vector<int> d[maxn];
int w[maxn];
long long vis[maxn];
int ans[maxn];
int tot;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", w + i);
    d[w[i]].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    for (auto j : d[i]) {
      if (vis[j] != (i - 1) * 1ll * i / 2) {
        printf("-1\n");
        return 0;
      }
      ans[++tot] = j;
      for (auto k : e[j]) {
        if (vis[k] != (i + 1) * 1ll * i / 2) {
          vis[k] += i;
        }
      }
    }
  }
  for (int i = 1; i <= tot; ++i) {
    printf("%d ", ans[i]);
  }
  printf("\n");
}
