#include <bits/stdc++.h>
using namespace std;
const int M = 100005;
vector<int> adj[M], res;
bool vis[M], ispref[M];
int pref[M], level[M], par[M];
void dfs(int node, int lev) {
  level[node] = lev + 1;
  for (int i = 0; i < adj[node].size(); i++) {
    dfs(adj[node][i], lev + 1);
  }
  if (ispref[node]) res.push_back(node);
}
bool dfs2(int st, int node) {
  if (ispref[node] && node != st) return 1;
  if (level[pref[node]] < level[st]) return 0;
  bool ret = 1;
  for (int i = 0; i < adj[node].size(); i++) ret = ret & dfs2(st, adj[node][i]);
  return ret;
}
int main() {
  int n, m, p, q;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &p, &q);
    adj[p].push_back(q);
    par[q] = p;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p);
    ispref[p] = 1;
    pref[i] = p;
  }
  for (int i = 1; i <= n; i++)
    if (!par[i]) dfs(i, 0);
  for (int i = 0; i < res.size(); i++) {
    int p = res[i];
    if (!dfs2(p, p)) {
      puts("-1");
      return 0;
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) printf("%d\n", res[i]);
  return 0;
}
