#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 1e5 + 10, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int n, m;
int x, y;
int fa[N];
vector<int> a[N];
int g[N];
bool flag[N];
vector<int> ans;
bool dfs(int x) {
  for (int i = a[x].size() - 1; ~i; --i) {
    int y = a[x][i];
    if (y == fa[x]) continue;
    if (!dfs(y)) return 0;
    if (g[y] && g[y] != g[x]) return 0;
  }
  if (flag[x]) {
    if (g[x] != x) return 0;
    g[x] = 0;
    ans.push_back(x);
  }
  return 1;
}
bool check() {
  ans.clear();
  for (int i = 1; i <= n; ++i)
    if (fa[i] == 0) {
      if (!dfs(i)) return 0;
    }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) printf("%d\n", ans[i]);
  return 1;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; ++i) {
      a[i].clear();
      fa[i] = 0;
      flag[i] = 0;
    }
    for (int i = 1; i <= m; ++i) {
      scanf("%d%d", &x, &y);
      a[x].push_back(y);
      fa[y] = x;
    }
    for (int i = 1; i <= n; ++i) scanf("%d", &g[i]), flag[g[i]] = 1;
    if (!check()) puts("-1");
  }
  return 0;
}
