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;
const long long infl = 1e18 + 5;
long long int n, m, k, q, x, y, mx = -1, mn = infl, f, val, sz, sm, cnt, ans,
                                t = 1, i, j, ind = -1;
vector<vector<long long int> > matmul(vector<vector<long long int> > &a,
                                      vector<vector<long long int> > &b) {
  long long int n = (long long int)a.size();
  vector<vector<long long int> > ans(n, vector<long long int>(n, 0));
  long long int i, j, k;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      for (k = 0; k < n; k++) {
        ans[i][j] += a[i][k] * b[k][j];
        ans[i][j] %= 1000000007;
      }
    }
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) b[i][j] = ans[i][j];
  return b;
}
vector<long long int> mymul(vector<vector<long long int> > &a,
                            vector<long long int> &v) {
  long long int i;
  long long int sm = 0;
  long long int n = (long long int)v.size();
  long long int ans[n];
  for (i = 0; i < n; i++) {
    sm = 0;
    for (j = 0; j < n; j++) {
      sm += v[j] * a[j][i];
      sm %= 1000000007;
    }
    ans[i] = sm;
  }
  for (i = 0; i < n; i++) v[i] = ans[i];
  return v;
}
vector<vector<long long int> > matexp(vector<vector<long long int> > &a,
                                      long long int k) {
  long long int m = k;
  long long int i, j;
  int n = (long long int)a.size();
  vector<vector<long long int> > ans(n, vector<long long int>(n, 0));
  for (i = 0; i < n; i++) ans[i][i] = 1;
  while (m > 0) {
    if (m % 2 == 1) {
      matmul(a, ans);
    }
    matmul(a, a);
    m /= 2;
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) a[i][j] = ans[i][j];
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  cin >> n >> k;
  long long int a[n];
  std::vector<long long int> v(n);
  vector<vector<long long int> > z(n, vector<long long int>(n, 0));
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      val = a[i] ^ a[j];
      cnt = 0;
      while (val > 0) {
        cnt += val % 2;
        val /= 2;
      }
      if (cnt % 3 == 0) z[i][j] = 1;
    }
  }
  for (i = 0; i < n; i++) v[i] = 1;
  matexp(z, k - 1);
  v = mymul(z, v);
  for (i = 0; i < n; i++) {
    ans += v[i];
    ans %= 1000000007;
  }
  cout << ans;
  return 0;
}