t=[int(i) for i in input().split()] s=[int(i) for i in input().split()] sum1=int(t[0]*t[1]) if total>=sum1-sum(s): print(total) else: print(-1)