A = list(map(int,input().split())) B = list(map(int,input().split())) a = A[0] * A[1] if a < sum(B): print("-1") else : print(a - sum(B))