Problem: You are given n integers a1, a2, ..., an.

A sequence of integers x1, x2, ..., xk is called a "xor-sequence" if for every 1 ≤ i ≤ k - 1 the number of ones in the binary representation of the number xi <image> xi + 1's is a multiple of 3 and <image> for all 1 ≤ i ≤ k. The symbol <image> is used for the binary exclusive or operation.

How many "xor-sequences" of length k exist? Output the answer modulo 109 + 7.

Note if a = [1, 1] and k = 1 then the answer is 2, because you should consider the ones from a as different.

Input

The first line contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 1018) — the number of given integers and the length of the "xor-sequences".

The second line contains n integers ai (0 ≤ ai ≤ 1018).

Output

Print the only integer c — the number of "xor-sequences" of length k modulo 109 + 7.

Examples

Input

5 2
15 1 2 4 8


Output

13


Input

5 1
15 1 2 4 8


Output

5

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{
	
	static final int mod = (int)1e9+7;
	static int n;
	static long k;
	static int[][] g;
	static int N = 105;
	
	
    public static void main(String[] args) throws IOException {
     
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    	
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		n = fs.nextInt();
    		k = fs.nextLong();
    		
    		long[] a = new long[N];
    		for(int i=1;i<=n;i++) {
    			a[i] = fs.nextLong();
    		}
    		
    		g = new int[N][N];
    		for(int i=1;i<=n;i++) {
    			for(int j=1;j<=n;j++) {
    				g[i][j] = (count(a[i]^a[j])%3==0)?1:0;
    			}
    		}
    		
    		bexp(g, k-1);
    		
    		
    		int ans = 0;
    		for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) ans = add(ans, g[i][j]);
    		
    		out.println(ans);
    		
    		
    		
    		
    		
    		
    	}
    	
    		
    		
    		
    	out.close();
    		
    }
    
    
    static void bexp(int[][] a, long p) {
    	int[][] ans = new int[N][N];
    	for(int i=1;i<=n;i++) ans[i][i] = 1;
    	
    	while(p>0) {
    		if((p&1)==1) mul(ans, a);
    		mul(a, a);
    		p = p>>1;
    	}
    	
    	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) a[i][j] = ans[i][j];
    	
    }
    
    
    
    
    
    
    static void mul(int[][] a, int[][] b) {
    	int[][] c = new int[N][N];
    	for(int i=1;i<=n;i++) {
    		for(int j=1;j<=n;j++) {
    			c[i][j] = 0;
    			for(int k=1;k<=n;k++) {
    				c[i][j] = add(c[i][j], mul(a[i][k], b[k][j]));
    			}
    		}
    	}
    	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) a[i][j] = c[i][j];
    }
    
    
    static int count(long n) {
    	int ans = 0;
    	while(n>0) {
    		ans++;
    		n = n&(n-1);
    	}
    	return ans;
    }
    
    
    
    
    static int add(int a, int b) {
    	a += b;
    	if(a>=mod) return a-mod;
    	return a;
    }
    
    
    static int mul(int a, int b) {
    	return (int)(((long)a*b)%mod);
    }
    
    
    
    
    
    
    
    
    static final Random random=new Random();
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}