#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T &&t, V &&...v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const int MAXN = 5e5 + 100;
int n, m, b[MAXN];
vector<int> adj[MAXN];
vector<int> a[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x, y;
  for (int i = 0; i < (int)(m); i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int tmp, mx = -1;
  for (int i = 1; i <= n; i++) {
    cin >> tmp;
    mx = max(mx, tmp);
    a[tmp].push_back(i);
  }
  vector<int> vv(n + 1);
  for (int i = 1; i <= mx; i++) {
    for (int j = 0; j < (int)(a[i].size()); j++) {
      int u = a[i][j];
      for (int k = 0; k < (int)(adj[u].size()); k++) {
        int v = adj[u][k];
        vv[b[v]] = 1;
      }
      for (int j = 1; j < i; j++) {
        if (!vv[j]) {
          cout << -1 << endl;
          return 0;
        }
      }
      if (vv[i]) {
        cout << -1 << endl;
        return 0;
      }
      for (int j = 1; j <= i; j++) {
        vv[j] = 0;
      }
      b[u] = i;
    }
  }
  for (int i = 1; i <= mx; i++) {
    for (int j = 0; j < (int)(a[i].size()); j++) {
      cout << a[i][j] << " ";
    }
  }
  cout << endl;
  return 0;
}
