import sys input = sys.stdin.readline N, X = map(int, input().split()) S = list(map(int, input().split())) su = sum(S) for Si in S: if Si%2==0: t = su-Si+Si//2 if t%(N-1)==0 and t//(N-1)==X: print(Si//2) exit()