#include #include using namespace std; 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 300 ll a[100000]; ll t[L]; int main(){ ll n, k; scanf("%lld%lld", &n, &k); t[0] = 1; rep(i, L-1) t[i+1] = t[i]*2%mod; rep(i, n) scanf("%lld", a+i); ll mu = (t[k*2-1]-t[k-1]+mod)%mod*n%mod; ll sg = 0; rep(i, k){ ll cnt = 0; rep(j, n) if(1&(a[j]>>i)) cnt++; 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; }