#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int n, m;
    cin >> n >> m;
    long long int a[n];
    vector<vector<long long int>> gr(n + 1);
    for (long long int i = 0; i < m; i++) {
      long long int x, y;
      cin >> x >> y;
      gr[x].push_back(y);
      gr[y].push_back(x);
    }
    vector<pair<long long int, long long int>> required(n + 1);
    vector<long long int> requirement(n + 1);
    for (long long int i = 1; i <= n; ++i) {
      long long int x;
      cin >> x;
      required[i] = {x, i};
      requirement[i] = x;
    }
    sort(required.begin(), required.end());
    long long int flag = 0;
    for (auto x : required) {
      if (x.first == 0 && x.second == 0) continue;
      long long int curr = x.second;
      long long int req = x.first;
      set<long long int> gg;
      for (auto y : gr[curr]) {
        long long int temp = (requirement[y]);
        if (temp < req)
          gg.insert(temp);
        else if (temp == req) {
          flag++;
          break;
        }
      }
      if (flag) break;
      if (gg.size() != req - 1) {
        flag = 1;
        break;
      }
    }
    if (flag) {
      cout << "-1\n";
    } else {
      for (auto x : required) {
        if (x.first == 0) continue;
        cout << x.second << " ";
      }
    }
  }
  return 0;
}
