N, M = map(int, input().split()) A = [int(s) for s in input().split()] V = [[int(i)-1 for i in input().split()] for m in range(M)] K = int(input()) B = [int(s) for s in input().split()] X = [0]*N for i in range(N): X[i] = [0]*N L = [0]*N for i in range(M): a = V[i][0] b = V[i][1] if A[a] < A[b]: X[a][b] = 1 else: if A[b] < A[a]: X[b][a] = 1 for i in range(K): L[B[i]-1] = 1 _, C = (list(t) for t in zip(*sorted(zip(A, list(range(N)))))) Y = [0]*N D = 0 S = 0 del A, B, V, K while sum(L) > 0: if D == N: break E = C[D] if L[E] == 0: D += 1 else: L[E] = 0 Y[S]=E+1 for i in range(N): if X[E][i] == 1: L[i] = (L[i]+1)%2 D += 1 S += 1 if D == N+1: print(-1) else: print(S) for i in range(S): print(Y[i])