#include <bits/stdc++.h>
using namespace std;
int n, m, f[100005] = {0}, a[100005] = {0}, d[100005] = {0}, as[100005] = {0},
          ans = 0, b[100005] = {0}, gg[100005];
vector<int> p[100005];
void fd(int now) {
  if (f[now] == 0) {
    d[now] = 1, as[now] = now, f[now] = now;
    return;
  }
  if (d[now] == 0) fd(f[now]);
  d[now] = d[f[now]] + 1, as[now] = as[f[now]];
  return;
}
void dfs(int now, int mx) {
  b[now] = 1;
  if (ans > 0) return;
  for (int i = 0; i < p[now].size(); i++) {
    int x = p[now][i];
    if (a[x] != mx && a[x] != x) {
      ans = 1;
      return;
    }
    if (a[x] == x) gg[m++] = x;
    dfs(x, a[x]);
  }
  return;
}
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &i, &j);
    f[j] = i;
    p[i].push_back(j);
  }
  for (i = 1; i <= n; i++) fd(i);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1, m = 0; i <= n; i++) {
    if (b[i] == 0 && f[i] == i) gg[m++] = i, dfs(i, a[i]);
    if (ans > 0) break;
  }
  if (ans > 0)
    printf("-1\n");
  else {
    printf("%d\n", m);
    for (i = m - 1; i >= 0; i--) printf("%d\n", gg[i]);
  }
  return 0;
}
