#include <bits/stdc++.h>
using namespace std;
string sum(string s1, string s2) {
  if (s1.length() < s2.length()) {
    string temp = s1;
    s1 = s2;
    s2 = temp;
  }
  int i, j;
  for (i = s1.length() - 1, j = s2.length() - 1; i >= 0; i--, j--) {
    s1[i] = char(s1[i] + (j >= 0 ? s2[j] - '0' : 0));
    if (s1[i] - '0' >= 10) {
      s1[i] = char((s1[i] - '0') % 10 + '0');
      if (i)
        s1[i - 1]++;
      else
        s1 = '1' + s1;
    }
  }
  return s1;
}
struct node {
  int w, t;
  int x;
};
node a[500010];
bool cmp(node b, node c) { return b.t < c.t; }
int pos[500010];
int ans[500010];
int go[2 * 500010], nex[2 * 500010], head[2 * 500010];
int cnt = 0;
void ct(int x, int y) {
  nex[++cnt] = head[x];
  go[cnt] = y;
  head[x] = cnt;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    ct(x, y);
    ct(y, x);
  }
  for (int i = 1; i <= n; i++) {
    int temp;
    scanf("%d", &temp);
    a[i].w = i;
    a[i].t = temp;
    a[i].x = 1;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    pos[a[i].w] = i;
  }
  int flag = 0;
  int num = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i].t == a[i].x) {
      ans[++num] = a[i].w;
    } else {
      flag = 1;
      break;
    }
    for (int j = head[a[i].w]; j; j = nex[j]) {
      int h = pos[go[j]];
      if (a[i].x == a[h].x) {
        a[h].x++;
      }
    }
  }
  if (flag == 1) {
    printf("-1\n");
  } else {
    for (int i = 1; i <= num; i++) {
      printf("%d", ans[i]);
      if (i == num) {
        printf("\n");
      } else {
        printf(" ");
      }
    }
  }
}
struct complex {
  double r, i;
  complex(double _r = 0.0, double _i = 0.0) {
    r = _r;
    i = _i;
  }
  complex operator+(const complex &b) { return complex(r + b.r, i + b.i); }
  complex operator-(const complex &b) { return complex(r - b.r, i - b.i); }
  complex operator*(const complex &b) {
    return complex(r * b.r - i * b.i, r * b.i + i * b.r);
  }
};
