#d1203. 函数求和

函数求和

Sum of Function Values

Problem Description

You are given nn integers a1,a2,…,ana_1, a_2, \dots, a_n and a positive integer kk with 0≤ai≤2k−10 \le a_i \le 2^k - 1.

Define the function f(x)f(x) to be the smallest ii satisfying ai&x≠aia_i \mathbin{\&} x \neq a_i; when no such ii exists, f(x)=0f(x) = 0.

Compute ∑i=02k−1f(i)\sum_{i=0}^{2^k-1} f(i). Since the answer may be large, output it modulo 998244353998244353.

Input Format

The first line contains two integers nn and kk.

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n, the given numbers.

Output Format

One integer on a single line: the answer.

Sample Input 1

2 1
0 1

Sample Output 1

2

Sample Input 2

2 2
2 1

Sample Output 2

4

Sample Input 3

5 10
389 144 883 761 556

Sample Output 3

1118

Sample Explanation

For sample 1, f(0)=2f(0) = 2, f(1)=0f(1) = 0, so the answer is 22.

Constraints

For all data, 1≤n≤1001 \le n \le 100 and 1≤k≤601 \le k \le 60.