#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    T t = bigmod(p, e / 2, M);
    return (t * t) % M;
  }
  return (bigmod(p, e - 1, M) * p) % M;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T multimod(T a, T b, T m) {
  T ans = 0ll;
  a %= m, b %= m;
  while (b) {
    if (b & 1ll) ans = m - ans > a ? (ans + a) : (ans + a - m);
    b >>= 1ll;
    a = (m - a) > a ? a + a : a + a - m;
  }
  return (T)ans;
}
vector<int> res, V[(1000000 + 7)];
bool vis[(1000000 + 7)];
int choice[(1000000 + 7)];
int lvl[(1000000 + 7)];
int deg[(1000000 + 7)];
int DFS(int u, int d) {
  lvl[u] = d;
  int ret = lvl[choice[u]];
  for (auto v : V[u]) {
    ret = min(ret, DFS(v, d + 1));
  }
  if (vis[u]) {
    if (ret < d) return -1;
    res.push_back(u);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int j, i;
  int n, m;
  int v, t, u;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    V[u].push_back(v);
    deg[v]++;
  }
  for (i = 1; i <= n; i++) {
    cin >> choice[i];
    vis[choice[i]] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (!deg[i]) {
      if (DFS(i, 1) < 1) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  cout << res.size() << endl;
  for (auto v : res) cout << v << endl;
  return 0;
}
