import os, sys if os.path.exists("input.txt"): sys.stdin = open('input.txt', 'r') read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines def inp(): return readline().rstrip().decode('utf-8') def inps(): return map(int, inp().split()) inp() B = list(inps()) if 0 in B: print(1) print(B.index(0) + 1) exit() di = {} di.setdefault(0, 0) xr = 0 for i, v in enumerate(B): xr ^= v if xr in di: print(i - di[xr] + 1) for j in range(di[xr], i + 1): print(j + 1, end = ' ') print() exit() di[xr] = i print(-1)