#include using namespace std; using ll = long long; template using vec = vector; template using vvec = vector>; template bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;} template bool chmax(T& a,T b){if(a=0;i--) #define all(x) (x).begin(),(x).end() #define debug(x) cerr << #x << " = " << (x) << endl; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,X; cin >> N >> X; vec A(N),S(N); rep(i,N){ cin >> S[i]; A[i] = X-S[i]; } ll sum = accumulate(all(A),0LL); rep(i,N) if(S[i]%2==0){ ll now = X-S[i]/2-A[i]; if(sum+now==X){ cout << S[i]/2 << "\n"; return 0; } } }