n, m = map(int, input().split()) a = list(map(int, input().split())) to = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 to[u].append(v) to[v].append(u) s = [False] * n k = int(input()) for bi in map(int, input().split()): bi -= 1 s[bi] = True ans = [] for u in sorted(range(n), key=lambda i: a[i]): if s[u]: s[u] = False ans.append(u + 1) for v in to[u]: if a[u] < a[v]: s[v] = not s[v] if any(s): print(-1) else: print(len(ans)) print(*ans, sep='\n')