import sys from collections import deque input = sys.stdin.buffer.readline n, m = map(int, input().split()) A = list(map(int, input().split())) graph = [[] for _ in range(n)] deg = [0] * n for _ in range(m): a, b = map(int, input().split()) a, b = a - 1, b - 1 if A[b] > A[a]: graph[a].append(b) deg[b] += 1 if A[a] > A[b]: graph[b].append(a) deg[a] += 1 k = int(input()) B = list(map(int, input().split())) finished = [0] * n lamp = [0] * n for b in B: lamp[b - 1] = 1 start = deque() for i in range(n): if deg[i] == 0: start.append(i) ans = [] while start: v = start.popleft() if lamp[v] == 0: finished[v] = 1 for u in graph[v]: if finished[u]: continue start.append(u) else: ans.append(v + 1) outflag = 0 lamp[v] = 0 finished[v] = 1 for u in graph[v]: lamp[u] ^= 1 if not finished[u]: start.append(u) if sum(lamp) > 0: print(-1) exit() print(len(ans)) for a in ans: print(a)