def solve(N,M,A,P): DP=[] D=[0]*(M+1); D[0]=1 for i in range(N,0,-1): E=D D=[0]*(M+1) a=A[i] for x in range(M+1): if x0: assert len(B)<=N for k in range(N): if (len(B)==0 or B[-1]=A[I[k]] and DP[I[k]][remain]==1: B.append(I[k]) remain-=A[I[k]] return B #================================================== N,M=map(int,input().split()) A=[-1]+list(map(int,input().split())) P=[-1]+list(map(int,input().split())) B=solve(N,M,A,P) if B==None: print(-1) else: print(len(B)) print(*B)