#!/usr/bin/env python in1 = [int(x) for x in input().split()] in2 = [int(x) for x in input().split()] totbeans = sum(in2) ans = in1[0] * in1[1] - totbeans if ans < 0: print(-1) else: print(ans)