#include <bits/stdc++.h>
using namespace std;
int giftto[110000], comp[110000], prnt[110000];
bool visited[110000];
vector<int> grph[110000];
vector<int> ansvec;
bool ans = 1;
void dfs(int node) {
  visited[node] = 1;
  for (int i = 0; i < grph[node].size(); i++)
    if (!visited[grph[node][i]]) dfs(grph[node][i]);
  if (giftto[node] == node)
    ansvec.push_back(node);
  else if ((prnt[node] != 0) && (giftto[node] != giftto[prnt[node]]))
    ans = 0;
}
int main() {
  memset(visited, 0, sizeof(visited));
  memset(prnt, 0, sizeof(prnt));
  int n, m, u, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    grph[u].push_back(v);
    prnt[v] = u;
  }
  for (int i = 1; i <= n; i++) cin >> giftto[i];
  for (int i = 1; i <= n; i++)
    if (!prnt[i]) dfs(i);
  if (!ans)
    cout << "-1";
  else {
    cout << ansvec.size() << endl;
    for (int i = 0; i < ansvec.size(); i++) cout << ansvec[i] << endl;
  }
  return 0;
}
