#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
struct fenwickTree {
  int tree[MAXN];
  fenwickTree() { this->Init(); }
  void Init() { memset(this->tree, 0, sizeof(this->tree)); }
  void update(int index, int value) {
    index++;
    while (index < MAXN) {
      this->tree[index] += value;
      index += index & (-index);
    }
  }
  int query(int index) {
    index++;
    int sum = 0;
    while (index > 0) {
      sum += this->tree[index];
      index -= index & (-index);
    }
    return sum;
  }
  int query(int l, int r) { return query(r) - query(l - 1); }
};
fenwickTree *T = new fenwickTree();
int n, m;
int parent[MAXN];
bool isWish[MAXN];
int treeSize[MAXN];
vector<int> graph[MAXN];
int dfsOrderIndex = 0;
int dfsOrder[MAXN];
int topSortIndex = 0;
int topSort[MAXN];
set<int> allWishes;
vector<int> wish2Nodes[MAXN];
bool fail = false;
vector<pair<int, int>> answer;
void DFSInit(int x) {
  dfsOrder[x] = dfsOrderIndex;
  dfsOrderIndex++;
  treeSize[x] = 1;
  for (int y : graph[x]) {
    DFSInit(y);
    treeSize[x] += treeSize[y];
  }
  topSort[x] = topSortIndex;
  topSortIndex++;
}
void DFS(int x) {
  if (isWish[x] == true &&
      T->query(dfsOrder[x], dfsOrder[x] + treeSize[x] - 1) != 0) {
    fail = true;
  }
  for (int u : wish2Nodes[x]) {
    T->update(dfsOrder[u], 1);
  }
  for (int y : graph[x]) {
    DFS(y);
  }
  for (int u : wish2Nodes[x]) {
    T->update(dfsOrder[u], -1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int p, q;
    cin >> p >> q;
    parent[q] = p;
    graph[p].push_back(q);
  }
  for (int i = 1; i <= n; i++) {
    if (parent[i] == 0) {
      DFSInit(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    isWish[x] = true;
    allWishes.insert(x);
    wish2Nodes[x].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (parent[i] == 0) {
      DFS(i);
    }
  }
  if (fail == true) {
    cout << "-1" << '\n';
    return 0;
  }
  for (auto it = allWishes.begin(); it != allWishes.end(); it++) {
    answer.push_back({topSort[*it], *it});
  }
  sort(answer.begin(), answer.end());
  cout << answer.size() << '\n';
  for (int i = 0; i < answer.size(); i++) {
    cout << answer[i].second << '\n';
  }
}
