#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n,m; cin>>n>>m; vector A(n); set s; rep(i,n){ cin>>A[i]; s.insert(A[i]); } sort(ALL(A)); if(m%2){ cout<<0<