#include <bits/stdc++.h>
using namespace std;
bool u[100005];
vector<int> topo, ans;
vector<int> g[100005];
int arr[100005], arr1[100005], arr2[100005];
void toposort(int v) {
  u[v] = true;
  for (int i = 0; i < g[v].size(); i++) {
    if (u[g[v][i]] == false) {
      toposort(g[v][i]);
    }
  }
  topo.push_back(v);
}
void dfs(int v, int x) {
  if (arr2[v] != 0) return;
  arr2[v] = x;
  for (int i = 0; i < g[v].size(); i++) {
    dfs(g[v][i], x);
  }
}
int main() {
  int n, m, i;
  cin >> n >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
  }
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    arr1[arr[i]] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (u[i] == false) {
      toposort(i);
    }
  }
  for (i = 0; i < topo.size(); i++) {
    if (arr1[topo[i]]) {
      dfs(topo[i], topo[i]);
      ans.push_back(topo[i]);
    }
  }
  for (i = 1; i <= n; i++) {
    if (arr2[i] != arr[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
