#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
vector<int> son[(200000 + 10)];
int a[(200000 + 10)], dep[(200000 + 10)], rt[(200000 + 10)];
int mark[(200000 + 10)];
int pre[(200000 + 10)];
bool found;
vector<int> ans;
bool dfs(int u) {
  bool f = 1;
  for (int i = 0; i < son[u].size(); ++i) {
    int v = son[u][i];
    dep[v] = dep[u] + 1;
    if (dfs(v) == 0 || (dep[a[v]] <= dep[u] && a[u] != a[v])) f = 0;
  }
  return f;
}
void gao(int u) {
  for (int i = 0; i < son[u].size(); ++i) {
    int v = son[u][i];
    gao(v);
  }
  if (mark[u]) ans.push_back(u);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    son[u].push_back(v);
    rt[v] = 1;
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), mark[a[i]] = 1;
  found = 1;
  for (int i = 1; i <= n; ++i) {
    if (rt[i] == 0) found &= dfs(i);
  }
  if (!found) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (rt[i] == 0) gao(i);
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); ++i) printf("%d\n", ans[i]);
}
