typedef long long ll; const ll mod = 1e9+9; #define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i)) #define rep(i,n) REP(i,0,n) #define L 250 ll a[100000]; ll t[L]; int main(){ ll n, k; scanf("%lld%lld", &n, &k); t[0] = 1; rep(i, L){ t[i+1] = t[i]<<1; if(i%2) t[i+1]%=mod; } rep(i, n) scanf("%lld", a+i); ll mu = (t[k*2-1]-t[k-1]+(mod<<1))%mod*n%mod; ll sg = 0; rep(i, k){ ll cnt = 0; rep(j, n) cnt += (1&(a[j]>>i)); ll df = abs(n-2*cnt); (sg+=df*df%mod*t[(i+k-1)*2]%mod); } printf("%lld\n%lld\n", mu, sg%mod); return 0; }