#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n, m;
int h[maxn + 10], e[maxn * 2 + 10], nex[maxn * 2 + 10], vis[maxn + 10];
int cnt[maxn + 10];
int sta[maxn + 10];
int arr[maxn + 10], head, tail;
int dfs(int x, int now) {
  if (cnt[x] && x != now) {
    arr[++tail] = x;
    return 0;
  }
  int sum = 1;
  for (int i = h[x]; i; i = nex[i]) sum += dfs(e[i], now);
  return sum;
}
void init() {
  cin >> n >> m;
  memset(h, 0, sizeof(h));
  memset(vis, 0, sizeof(vis));
  memset(cnt, 0, sizeof(cnt));
  int top = 0, a, b;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    e[++top] = b;
    nex[top] = h[a];
    h[a] = top;
    ++vis[b];
  }
  head = 1;
  tail = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a);
    ++cnt[a];
    if (!vis[i]) arr[++tail] = i;
  }
  sta[0] = 0;
  while (head <= tail) {
    int tmp = dfs(arr[head], arr[head]);
    cnt[arr[head]] -= tmp;
    if (cnt[arr[head]]) {
      printf("-1\n");
      return;
    }
    sta[++sta[0]] = arr[head];
    ++head;
  }
  printf("%d\n", sta[0]);
  for (int i = sta[0]; i >= 1; --i) printf("%d\n", sta[i]);
  return;
}
int main() {
  init();
  return 0;
}
