#include <bits/stdc++.h>
using namespace std;
int N, M;
int P[101010];
vector<int> C[101010];
vector<int> R;
int A[101010];
int T[101010];
int dfs(int cur) {
  int pt = 0;
  for (auto& r : C[cur]) pt += dfs(r);
  if (cur == 0) return 0;
  A[T[cur]]++;
  pt++;
  if (A[cur] > 0) {
    if (pt != A[cur]) {
      (void)printf("-1\n");
      exit(0);
    }
    R.push_back(cur);
    pt = 0;
  }
  return pt;
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> M;
  for (i = 0; i < (M); i++) {
    cin >> x >> y;
    P[y] = x;
    C[x].push_back(y);
  }
  for (i = 1; i <= N; i++)
    if (P[i] == 0) C[0].push_back(i);
  for (i = 1; i <= N; i++) cin >> T[i];
  dfs(0);
  (void)printf("%d\n", R.size());
  for (auto& r : R) (void)printf("%d\n", r);
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
