#include <bits/stdc++.h>
using namespace std;
int n, m, a[100005], b[100005], di[100005];
vector<int> G[100005], sol;
bool inSol[100005];
void DFS(int u, int val) {
  if (inSol[u]) val = u;
  b[u] = val;
  for (auto x : G[u]) DFS(x, val);
  if (inSol[u]) sol.push_back(u);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    G[x].push_back(y);
    ++di[y];
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    inSol[a[i]] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (!di[i]) {
      assert(inSol[i]);
      DFS(i, 0);
    }
  }
  for (int i = 1; i <= n; ++i)
    if (a[i] != b[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", (int)sol.size());
  for (auto x : sol) printf("%d\n", x);
  return 0;
}
