from collections import defaultdict N, M = map(int, input().split()) A = [0]+list(map(int, input().split())) task = [[0, 0]]+[[A[i], i] for i in range(1, N+1)] task.sort() Edges = defaultdict(set) for _ in range(M): u, v = map(int, input().split()) Edges[u].add(v) Edges[v].add(u) K = int(input()) B = set(map(int, input().split())) state = [int(i in B) for i in range(N+1)] ans = [] for a, v in task: if not state[v]: continue state[v] = 0 ans.append(v) for e in Edges[v]: if A[e] > a: state[e] ^= 1 if sum(state): print(-1) else: print(len(ans)) print(*ans, sep='\n')