#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
void in(int& x) {
  int y = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') y = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  x *= y;
}
void o(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) o(x / 10);
  putchar(x % 10 + '0');
}
int n, m;
vector<int> g[N];
struct Pair {
  int id, topic;
  bool operator<(const Pair& t) const { return topic < t.topic; }
} a[N];
int themin[N];
bool cal() {
  for (int i = 1; i <= n; i++) {
    if (themin[a[i].id] + 1 != a[i].topic) return false;
    for (int j = 0; j < g[a[i].id].size(); j++) {
      int v = g[a[i].id][j];
      if (themin[v] == a[i].topic || themin[v] == a[i].topic - 1) {
        themin[v] = a[i].topic;
      }
    }
  }
  return true;
}
signed main() {
  in(n);
  in(m);
  for (int u, v, i = 1; i <= m; i++) {
    in(u);
    in(v);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  for (int i = 1; i <= n; i++) {
    in(a[i].topic);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1);
  if (cal()) {
    for (int i = 1; i <= n; i++) {
      o(a[i].id);
      putchar(' ');
    }
    putchar('\n');
  } else {
    printf("-1\n");
  }
  return 0;
}
