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.*;



import java.util.*;



/*


*/

 
 public class B {
	static FastReader sc=null;
	static long mod=(long)1e9 + 7;
	
	public static void main(String[] args) {
		sc=new FastReader();
		int n=sc.nextInt();
		long k=sc.nextLong()-1;
		
		long a[]=new long[n];
		for(int i=0;i<n;i++)a[i]=sc.nextLong();
		
		long m[][]=new long[n][n];
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				long val=a[i]^a[j];
				if(Long.bitCount(val)%3==0)m[i][j]=1;
			}
		}
		
		long ans[][]=Mpow(m,n,k,mod);
		
		long sum=0;
		
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				sum=(sum+ans[i][j])%mod;
			}
		}
		System.out.println(sum);
		
		
	}
	static long[][] Identity(long I[][],long n)
	{
		//here we get the identity matrix which acts as the neutral element
	   for(int i=0;i<n;i++)
	    {
		   for(int j=0;j<n;j++)
	        {
	            I[i][j]=0;
	        }
	        I[i][i]=1;
	    }
	    return I;
	}

	static long[][] Multiply(int row1, int col1, long A[][],int row2, int col2, long B[][],long m)
	{
		//this function does the multiplication of two matrices
		int i, j, k;
		long C[][] = new long[row1][col2];
		
        for (i = 0; i < row1; i++) {
            for (j = 0; j < col2; j++) {
                for (k = 0; k < row2; k++) {
                	C[i][j] += A[i][k] * B[k][j];
                	C[i][j]=C[i][j]%m;
                }
           
            }
        }
        return C;
	}

	static long[][] Mpow(long p[][],int n,long y,long m)
	{
		//y is the power and m is the mod_value 
		
		long ans[][]=new long[n][n];
		//returns the identity matrix
	    if(y==0)
	    {
	        return Identity(ans,n);
	    }
	    long t[][]=new long[n][n];
	    
	    t=Mpow(p,n,y/2,m);
	    
	    long z[][]=Multiply(n,n,t,n,n,t,m);
	    if(y%2!=0)
	    {
	        ans=Multiply(n,n,z,n,n,p,m);
	    }
	    else
	    {
	        t=Identity(t,n);
	       ans= Multiply(n,n,z,n,n,t,m);
	    }
	    return ans;
	}
	
	static int[] ruffleSort(int a[]) {
		ArrayList<Integer> al=new ArrayList<>();
		for(int i:a)al.add(i);
		Collections.sort(al);
		for(int i=0;i<a.length;i++)a[i]=al.get(i);
		return a;
	}
	
	static void print(int a[]) {
		for(int e:a) {
			System.out.print(e+" ");
		}
		System.out.println();
	}
	
	static class FastReader{
		
		StringTokenizer st=new StringTokenizer("");
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		
		String next() {
			while(!st.hasMoreTokens()) 
				try {
					st=new StringTokenizer(br.readLine());
				}
			   catch(IOException e){
				   e.printStackTrace();
			   }
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int[] readArray(int n) {
			int a[]=new int[n];
			for(int i=0;i<n;i++)a[i]=sc.nextInt();
			return a;
		}
	}
	
	
}