#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 2;
vector<vector<int>> g(N);
vector<int> v;
bool has_par[N];
int depth[N];
int want[N];
bool vis[N];
bool vis2[N];
int n, m;
int cur;
void DFS(int i, int d) {
  depth[i] = d;
  for (int j = 0; j < (int)g[i].size(); ++j) {
    int child = g[i][j];
    DFS(child, d + 1);
  }
}
void DFS2(int i) {
  if (vis2[i]) return;
  vis2[i] = 1;
  if (want[i] != cur) {
    cout << -1;
    exit(0);
  }
  for (int j = 0; j < (int)g[i].size(); ++j) {
    int child = g[i][j];
    DFS2(child);
  }
}
void read() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    has_par[y] = x;
    g[x].push_back(y);
  }
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    if (!vis[x]) {
      vis[x] = 1;
      v.push_back(x);
    }
    want[i + 1] = x;
  }
}
int main() {
  read();
  for (int i = 1; i <= n; ++i) {
    if (!has_par[i]) {
      DFS(i, 0);
    }
  }
  vector<pair<int, int>> res;
  for (int i = 0; i < (int)v.size(); ++i) res.push_back({depth[v[i]], v[i]});
  sort(res.rbegin(), res.rend());
  for (int i = 0; i < (int)res.size(); ++i) {
    cur = res[i].second;
    DFS2(cur);
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < (int)res.size(); ++i) printf("%d\n", res[i].second);
  return 0;
}
