#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int n, flag = 0, m;
int wantsgift[100005];
vector<int> G[100005];
vector<int> ans;
int isroot[100005];
int giftsabove[100005];
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
void dfs(int v) {
  giftsabove[v] = 1;
  for (int i = 0; i < G[v].size(); i++) {
    dfs(G[v][i]);
    giftsabove[v] += giftsabove[G[v][i]];
  }
  if (wantsgift[v]) {
    ans.push_back(v);
    giftsabove[v] -= wantsgift[v];
    if (giftsabove[v] > 0) {
      flag = 1;
      return;
    }
  }
}
int main() {
  int i, j, fl, test, x, y;
  scanf("%d%d", &n, &m);
  memset(isroot, 1, sizeof(isroot));
  for (i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    isroot[y] = 0;
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    wantsgift[x]++;
  }
  for (i = 1; i <= n; i++) {
    if (isroot[i]) dfs(i);
    if (flag == 1) break;
  }
  if (flag)
    printf("-1\n");
  else {
    printf("%d\n", ans.size());
    for (i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  }
  return 0;
}
