import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { static final int MOD = 998244353; static int[] counts = new int[1 << 10]; static long[][][] dp; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); if (k > 10) { System.out.println(0); return; } while (n-- > 0) { counts[sc.nextInt()]++; } dp = new long[k][1 << 10][1 << 10]; for (long[][] arr1 : dp) { for (long[] arr2 : arr1) { Arrays.fill(arr2, -1); } } System.out.println(dfw(k - 1, (1 << 10) - 1, (1 << 10) - 1)); } static long dfw(int c, int idx, int v) { if (c < 0) { return 1; } if (idx == 0) { return 0; } if (dp[c][idx][v] < 0) { dp[c][idx][v] = (dfw(c, idx - 1, v) + ((v & idx) == idx ? dfw(c - 1, idx - 1, v ^ idx) * counts[idx] : 0)) % MOD; } return dp[c][idx][v]; } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }