#include <bits/stdc++.h>
using namespace std;
struct edge {
  int t, next;
} e[100005 * 2];
int ecnt;
int head[100005];
void addedge(int f, int t) {
  e[++ecnt] = (edge){t, head[f]};
  head[f] = ecnt;
  e[++ecnt] = (edge){f, head[t]};
  head[t] = ecnt;
}
int ans[100005];
int anscnt;
int mark[100005], sum[100005], ai[100005];
int n, m;
int fail;
int vis[100005], rt[100005];
void DFS(int u, int fr, int mk) {
  sum[u] = mk + mark[u];
  vis[u] = 1;
  if (sum[u] != sum[ai[u]]) fail = 1;
  for (int i = head[u]; i; i = e[i].next) {
    if (e[i].t != fr) DFS(e[i].t, u, sum[u]);
  }
  if (mark[u]) ans[++anscnt] = u;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int f, t;
    scanf("%d%d", &f, &t);
    addedge(f, t);
    rt[t] = -1;
  }
  for (int i = 1; i <= n; i++) scanf("%d", &ai[i]), mark[ai[i]] = 1;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0 && rt[i] != -1) DFS(i, 0, 0);
  }
  if (fail == 1) {
    puts("-1");
  } else {
    printf("%d\n", anscnt);
    for (int i = 1; i <= anscnt; i++) printf("%d\n", ans[i]);
  }
  return 0;
}
