#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct Edge {
  int v, next;
} edge[N];
int head[N], tot, d[N], n, m, a[N], ret[N];
void add(int u, int v) {
  edge[tot].v = v;
  edge[tot].next = head[u];
  head[u] = tot++;
}
stack<int> s;
bool vis[N];
void dfs(int u, int fir) {
  if (vis[u]) fir = u, s.push(u);
  ret[u] = fir;
  for (int i = head[u]; ~i; i = edge[i].next) dfs(edge[i].v, fir);
}
int main() {
  scanf("%d%d", &n, &m);
  memset(head, -1, sizeof(head));
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    ++d[v];
    add(u, v);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    vis[a[i]] = true;
  }
  for (int i = 1; i <= n; ++i)
    if (!d[i]) dfs(i, i);
  for (int i = 1; i <= n; ++i)
    if (ret[i] != a[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", s.size());
  while (!s.empty()) {
    printf("%d\n", s.top());
    s.pop();
  }
  return 0;
}
