#include <bits/stdc++.h>
using namespace std;
vector<int> vec[110000];
bool son[110000];
int wi[110000];
bool flag;
bool vis[110000];
int ans[110000];
int as;
void dfs2(int wz, int po) {
  if (wi[wz] == po || wi[wz] == wz)
    po = wi[wz];
  else
    flag = 1;
  vis[wi[wz]] = 1;
  for (int j = 0; j < vec[wz].size(); ++j) {
    dfs2(vec[wz][j], po);
  }
}
void dfs3(int wz) {
  for (int j = 0; j < vec[wz].size(); ++j) {
    dfs3(vec[wz][j]);
  }
  if (vis[wz] == 1) {
    ++as;
    ans[as] = wz;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int j = 1; j <= m; ++j) {
    int p, q;
    scanf("%d%d", &p, &q);
    vec[p].push_back(q);
    son[q] = 1;
  }
  for (int j = 1; j <= n; ++j) {
    scanf("%d", &wi[j]);
  }
  flag = 0;
  for (int j = 1; j <= n; ++j) {
    if (son[j] == 0) {
      dfs2(j, 1);
    }
  }
  if (flag == 1)
    printf("-1\n");
  else {
    as = 0;
    for (int j = 1; j <= n; ++j) {
      if (son[j] == 0) {
        dfs3(j);
      }
    }
    printf("%d\n", as);
    for (int j = 1; j <= as; ++j) {
      printf("%d\n", ans[j]);
    }
  }
  return 0;
}
