s = [int(t) for t in input().split()] m = sum([int(k) for k in input().split()]) x = s[0]*s[1] print(x-m) if x-m >= 0 else print(-1)