#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> G[N];
list<int> l, ans;
int fa[N], exc[N];
int flag = 1;
void dfs(int rt) {
  int mark = 0;
  if (exc[rt] == rt)
    l.push_front(exc[rt]), mark = 1;
  else if (exc[rt] != *l.begin())
    flag = 0;
  for (auto& v : G[rt]) {
    dfs(v);
  }
  if (mark) ans.push_back(*l.begin()), l.pop_front();
}
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    fa[b] = a;
    G[a].push_back(b);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", exc + i);
  for (int i = 1; i <= n; ++i) {
    if (fa[i] == 0) dfs(i);
  }
  if (!flag) return 0 * printf("-1\n");
  printf("%d\n", (int)ans.size());
  for (int& x : ans) printf("%d\n", x);
}
