#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[100001];
int a[100001], ans[100001];
bool pres[100001], vis[100001];
stack<int> topo;
void tdfs(int u) {
  if (vis[u]) return;
  vis[u] = true;
  for (int v : adj[u]) tdfs(v);
  topo.push(u);
}
void dfs(int u, int p) {
  if (vis[u]) return;
  if (pres[u]) p = u;
  ans[u] = p;
  vis[u] = true;
  for (int v : adj[u]) {
    dfs(v, p);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m;
  cin >> n >> m;
  for (int im = 0, u, v; im < m; im++) {
    cin >> u >> v;
    adj[u].push_back(v);
  }
  for (int u = 1; u <= n; u++) {
    cin >> a[u], pres[a[u]] = true;
    tdfs(u);
  }
  memset(vis, 0, sizeof(vis));
  stack<int> tans;
  while (not topo.empty()) {
    int u = topo.top();
    if (pres[u]) tans.push(u);
    topo.pop();
    dfs(u, u);
  }
  bool pos = true;
  for (int u = 1; u <= n; u++) {
    if (ans[u] != a[u]) pos = false;
  }
  if (!pos) {
    cout << "-1\n";
  } else {
    cout << tans.size() << '\n';
    while (not tans.empty()) cout << tans.top() << '\n', tans.pop();
  }
  return 0;
}
