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 final class xor_sequences
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static long[][] base,val;
	static long mod=(long)(1e9+7);
	static long[] a;
	static int n;
	
	static long[][] identity_matrix()
	{
		long[][] id=new long[n][n];
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(j==i)
				{
					id[j][i]=1;
				}
			}
		}
		return id;
	}
	
	static long[][] matrix_mul(long[][] a,long[][] b,int r1,int c1,int r2,int c2)
	{
		long[][] c=new long[r1][c2];
		for(int i=0;i<r1;i++)
		{
			for(int j=0;j<c2;j++)
			{
				for(int k=0;k<c1;k++)
				{
					c[i][j]=(c[i][j]+(a[i][k]*b[k][j]))%mod;
				}
			}
		}
		return c;
	}
	
	static long[][] matrix_pow(long[][] base,long b)
	{
		long[][] res=identity_matrix();
		while(b>0)
		{
			if(b%2==1)
			{
				res=matrix_mul(res,base,n,n,n,n);
			}
			base=matrix_mul(base,base,n,n,n,n);
			b=b/2;
		}
		return res;
	}
	
	public static void main(String args[]) throws Exception
	{
		n=sc.nextInt();long k=sc.nextLong();a=new long[n];base=new long[n][n];val=new long[1][n];
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextLong();
			val[0][i]=1;
		}
		for(int i=0;i<n;i++)
		{
			for(int j=i;j>=0;j--)
			{
				if(Long.bitCount(a[i]^a[j])%3==0)
				{
					base[i][j]=base[j][i]=1;
				}
			}
		}
		base=matrix_pow(base,k-1);long[][] ans=matrix_mul(val,base,1,n,n,n);long res=0;
		for(int i=0;i<n;i++)
		{
			res=(res+ans[0][i])%mod;
		}
		out.println(res);out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}