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