#include <bits/stdc++.h>
using namespace std;
void _read(int &x) {
  x = 0;
  char ch = getchar();
  bool flag = false;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = true;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  if (flag) x = -x;
}
struct edge {
  int to, next;
} e[200005];
int N, M, _T, edge_ct, B[200005], head[200005], f[200005], pre[200005];
void add(int x, int y) {
  e[++edge_ct] = (edge){y, head[x]};
  head[x] = edge_ct;
  return;
}
bool flag;
int dp1[200005];
void DFS(int now) {
  dp1[now] = 0;
  for (int id = head[now]; id; id = e[id].next) {
    if (e[id].to == f[now]) continue;
    DFS(e[id].to);
  }
  for (int id = head[now]; id; id = e[id].next) {
    if (e[id].to == f[now]) continue;
    if (dp1[e[id].to]) continue;
    if (pre[e[id].to] != pre[now]) {
      flag = false;
    }
  }
  if (pre[now] == now) B[++_T] = now, dp1[now] = 1;
  ;
  return;
}
int main() {
  _read(N);
  _read(M);
  for (int i = 1; i <= N; i++) f[i] = i;
  for (int x, y, i = 1; i <= M; i++) {
    _read(x);
    _read(y);
    if (x != y) add(x, y), f[y] = x;
  }
  for (int i = 1; i <= N; i++) _read(pre[i]);
  flag = true;
  for (int i = 1; i <= N; i++) {
    if (!flag) break;
    if (f[i] == i) DFS(i);
  }
  if (!flag) {
    _T = -1;
  }
  printf("%d\n", _T);
  for (int i = 1; i <= _T; i++) printf("%d\n", B[i]);
  return 0;
}
