n, x = map(int, input().split()) s = list(map(int, input().split())) fromLeft = [0] * (n + 1) fromRight = [0] * (n + 1) for i in range(len(s)): fromLeft[i + 1] = fromLeft[i] + s[i] for i in reversed(range(len(s))): fromRight[i] = fromRight[i + 1] + s[i] for i in range(len(s)): if s[i] % 2 != 0: continue half = s[i] // 2 if fromLeft[i] + fromRight[i + 1] + half == (n - 1) * x: print(half) exit()