n,t=map(int,input().split()) L=list(map(int,input().split())) k=int(input()) A=list(map(int,input().split())) ans=10**6 for bit in range(2**k): tmp=[] cnt=0 for i in range(k): if bit>>i&1: cnt+=1 tmp.append(A[i]) tmp=tmp[::-1] T=t now=0 flag=1 for e in L: if tmp: if now<=tmp[-1]<=now+e and tmp[-1]