#include <bits/stdc++.h>
using namespace std;
vector<int> g[510000], color, ans;
void solve() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> blogs;
  map<int, int> them;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    int theme;
    color.push_back(false);
    cin >> theme;
    them[i] = theme;
    blogs.push_back({theme, i});
  }
  sort(blogs.begin(), blogs.end());
  for (auto blog : blogs) {
    vector<int> neigbours;
    int v = blog.second;
    int theme = blog.first;
    for (auto sosed : g[v]) {
      if (!color[sosed]) {
        continue;
      }
      neigbours.push_back(them[sosed]);
    }
    sort(neigbours.begin(), neigbours.end());
    int minn_empty = -1;
    for (int i = 0; i < neigbours.size() - 1 && neigbours.size() > 0; i++) {
      if (i == 0 && neigbours[i] > 1) {
        minn_empty = 1;
      }
      if (neigbours[i + 1] - neigbours[i] > 1 && minn_empty == -1) {
        minn_empty = neigbours[i] + 1;
      }
    }
    if (neigbours.size() == 0) {
      minn_empty = 1;
    }
    if (minn_empty == -1) {
      minn_empty = neigbours[neigbours.size() - 1] + 1;
    }
    if (minn_empty != theme) {
      cout << "-1\n";
      return;
    }
    ans.push_back(v);
    color[v] = true;
  }
  for (auto v : ans) {
    cout << v + 1 << " ";
  }
}
int main() {
  solve();
  return 0;
}
