s=list(map(int,input().split())) m=s[0]*s[1] n=sum(list(map(int,input().split()))) print( m-n if m >= n else -1 )