import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n, x = map(int, input().split()) S = list(map(int, input().split())) tot = sum(S) for i in range(n): if S[i] % 2 == 0: if tot - S[i] // 2 == x * (n - 1): print(S[i] // 2) break if __name__ == '__main__': resolve()