#include <iostream>
using namespace std;

long long N, K, A[100009], sigma, sum, mod = 1000000009;

int main() {
	cin >> N >> K;
	for (int i = 1; i <= N; i++) cin >> A[i];
	for (int i = 0; i < K; i++) {
		long long P1 = 0, P2 = 0;
		for (int j = 1; j <= N; j++) {
			if ((A[j] / (1LL << i)) % 2 == 0) P1 += (1LL << i);
			else P2 += (1LL << i);
			P1 %= mod; P2 %= mod;
		}
		P1 %= mod; P2 %= mod;
		long long S1 = sigma + ((1LL << i) % mod)*((P1*P1) % mod) + (2LL * P1*sum); S1 %= mod;
		long long S2 = sigma + ((1LL << i) % mod)*((P2*P2) % mod) + (2LL * P2*sum); S2 %= mod;
		long long T = sum * 2LL; T += ((1LL << i) % mod)*((P1 + P2) % mod); T %= mod;
		sigma = S1 + S2; sigma %= mod; sum = T;
	}
	cout << sum << endl;
	long long ans = sigma;
	for (int i = 0; i < K; i++) { ans *= 2; ans %= mod; }
	ans = ans - (sum*sum) % mod + mod; ans %= mod;
	cout << ans << endl;
	return 0;
}