#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1;
int n, m, f[MAX], g[MAX];
vector<int> s[MAX], ans;
bool o[MAX];
int dfs(int x) {
  int z = g[x];
  for (int y : s[x]) {
    int a = dfs(y);
    if (a != -2 && a != z) {
      return -1;
    }
  }
  if (o[x]) {
    ans.push_back(x);
    return -2;
  }
  return z;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int p, q;
    cin >> p >> q;
    f[q] = p;
    s[p].push_back(q);
  }
  for (int i = 1; i <= n; i++) {
    cin >> g[i];
    o[g[i]] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!f[i]) s[0].push_back(i);
  if (dfs(0) == -1)
    cout << -1 << '\n';
  else {
    cout << ans.size() << '\n';
    for (int x : ans) cout << x << '\n';
  }
  return 0;
}
