#include <bits/stdc++.h>
using namespace std;
bool inAns[100010], isRoot[100010];
vector<int> ans, tree[100010];
int target[100010], depth[100010];
int n;
bool go(int i, int cur, int curDepth) {
  depth[i] = curDepth;
  if (inAns[target[i]] && target[i] != cur) return 0;
  if (!inAns[target[i]]) {
    if (target[i] != i) return 0;
    inAns[target[i]] = 1;
    ans.push_back(target[i]);
    cur = target[i];
  }
  for (int j : tree[i])
    if (!go(j, cur, curDepth + 1)) return 0;
  return 1;
}
int main() {
  int nEdges;
  scanf("%d%d", &n, &nEdges);
  memset(isRoot, 1, sizeof(isRoot));
  for (int i = 0, a, b; i < nEdges; ++i) {
    scanf("%d%d", &a, &b);
    tree[a].push_back(b);
    isRoot[b] = 0;
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &target[i]);
  for (int i = 1; i <= n; ++i)
    if (isRoot[i]) {
      ans.push_back(i);
      inAns[i] = 1;
      if (!go(i, i, 0)) {
        printf("-1\n");
        return 0;
      }
    }
  printf("%d\n", ans.size());
  for (int i = ans.size() - 1; i >= 0; --i) printf("%d\n", ans[i]);
  return 0;
}
