n, T_ = map(int, input().split()) T = list(map(int, input().split())) k = int(input()) X = list(map(int, input().split())) l = -1 r = k + 1 def ok(x): a = T_ xp = 0 pos = 1 for t in T: a -= t if a <= 0: return False pos += 1 if xp < x and X[xp] == pos: a += 10 xp += 1 return True while r - l > 1: mid = (l + r) // 2 if ok(mid): r = mid else: l = mid if r == k + 1: print(-1) else: print(r)