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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if ((a == 0) || (b == 0)) return a + b;
  return gcd(b, a % b);
}
long long pow_mod(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long pow_2(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
bool isPrime(long long a) {
  for (int i = 3; (i * i) <= a; i += 2) {
    if ((a % i) == 0) return false;
  }
  if ((a != 2) && ((a % 2) == 0)) return false;
  return true;
}
string con_ll_to_str(int a) {
  stringstream mystr;
  mystr << a;
  return mystr.str();
}
long long con_str_to_ll(string st) {
  long long numb = 0;
  int len = st.size(), i, j = 0;
  for (i = len - 1; i >= 0; i--) {
    numb += (pow_mod(10, j) * (st[i] - '0'));
    j++;
  }
  return numb;
}
long long baseno_to_decimal(string st, long long basee) {
  long long i = 0, j, anss = 0;
  for (j = (int)st.length() - 1; j >= 0; j--) {
    anss += (st[j] - '0') * pow_2(basee, i);
    i++;
  }
  return anss;
}
string decimal_to_string(long long num, long long basee) {
  long long i = 0, j, opop;
  string anss = "";
  vector<string> stri;
  stri.push_back("0");
  stri.push_back("1");
  stri.push_back("2");
  stri.push_back("3");
  stri.push_back("4");
  stri.push_back("5");
  stri.push_back("6");
  stri.push_back("7");
  stri.push_back("8");
  stri.push_back("9");
  stri.push_back("A");
  stri.push_back("B");
  stri.push_back("C");
  stri.push_back("D");
  stri.push_back("E");
  stri.push_back("F");
  while (num) {
    opop = num % basee;
    anss += stri[opop];
    num /= basee;
  }
  reverse(anss.begin(), anss.end());
  return anss;
}
long long arr[110], mat[110][110], mat2[110][110], N, mat4[110][110];
void multip(long long K) {
  if (K == 1) return;
  multip(K / 2);
  long long i, j, k;
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      for (k = 1; k <= N; k++) {
        mat4[i][j] =
            (mat4[i][j] + ((mat[i][k] * mat[k][j]) % 1000000007)) % 1000000007;
      }
    }
  }
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      mat[i][j] = mat4[i][j];
      mat4[i][j] = 0;
    }
  }
  if (K % 2) {
    for (i = 1; i <= N; i++) {
      for (j = 1; j <= N; j++) {
        for (k = 1; k <= N; k++) {
          mat4[i][j] = (mat4[i][j] + ((mat[i][k] * mat2[k][j]) % 1000000007)) %
                       1000000007;
        }
      }
    }
    for (i = 1; i <= N; i++) {
      for (j = 1; j <= N; j++) {
        mat[i][j] = mat4[i][j];
        mat4[i][j] = 0;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long K, i, j;
  string st;
  cin >> N >> K;
  for (i = 1; i <= N; i++) {
    cin >> arr[i];
  }
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      if (__builtin_popcountll(arr[i] ^ arr[j]) % 3 == 0) {
        mat[i][j] = 1;
        mat2[i][j] = 1;
      }
    }
  }
  if (K == 1) {
    cout << N;
    return 0;
  }
  multip(K - 1);
  long long anss = 0;
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      anss = (anss + mat[i][j]) % 1000000007;
    }
  }
  cout << anss;
  return 0;
}