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;
template <class T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T my_pow(T n, T p) {
  if (p == 0) return 1;
  T x = my_pow(n, p / 2);
  x = (x * x);
  if (p & 1) x = (x * n);
  return x;
}
template <class T>
T big_mod(T n, T p, T m) {
  if (p == 0) return (T)1;
  T x = big_mod(n, p / 2, m);
  x = (x * x) % m;
  if (p & 1) x = (x * n) % m;
  return x;
}
template <class T>
T extract(string s, T ret) {
  stringstream ss(s);
  ss >> ret;
  return ret;
}
string itos(long long n) {
  string s;
  while (n) {
    s += (n % 10 + 48);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
long long stoi(string s) {
  long long n = 0;
  for (__typeof(s.size()) i = 0; i < (s.size()); i++) n = n * 10 + (s[i] - 48);
  return n;
}
double DEG(double x) { return (180.0 * x) / (acos(-1.0)); }
double RAD(double x) { return (x * (double)acos(-1.0)) / (180.0); }
template <typename T>
T DIS(T x1, T y1, T x2, T y2) {
  return sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}
template <typename T>
T ANGLE(T x1, T y1, T x2, T y2) {
  return atan(double(y1 - y2) / double(x1 - x2));
}
template <typename T>
long long isLeft(T a, T b, T c) {
  return (c.x - a.x) * (b.y - a.y) - (b.x - a.x) * (c.y - a.y);
}
const long long int MOD = 1e9 + 7;
long long ar[1002], br[1002];
long long a = 0, b = 0, c = 0, r = 0, rr = 0, res = 0, n, t = 0, ks = 0, k;
string s;
struct info {
  long long m[105][105];
} base;
info multi(info aa, info bb) {
  info mat;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      mat.m[i][j] = 0;
      long long tot = 0;
      for (int k = 0; k < n; k++) {
        tot = (tot + aa.m[i][k] * bb.m[k][j]) % MOD;
      }
      mat.m[i][j] = tot;
    }
  }
  return mat;
}
info bigmod(info ee, long long k) {
  info ans = ee;
  k--;
  while (k > 0) {
    if (k & 1) {
      ans = multi(ans, ee);
    }
    ee = multi(ee, ee);
    k /= 2;
  }
  return ans;
}
int main() {
  cin >> n;
  cin >> k;
  for (__typeof(n) i = 0; i < (n); i++) cin >> ar[i];
  for (__typeof(n) i = 0; i < (n); i++) {
    for (__typeof(n) j = 0; j < (n); j++) {
      long long aa = ar[i] ^ ar[j];
      int dd = __builtin_popcountll(aa);
      if (dd % 3 == 0) base.m[i][j] = 1;
    }
  }
  if (k == 1) {
    cout << n;
    return 0;
  }
  info ans = bigmod(base, k - 1);
  for (__typeof(n) i = 0; i < (n); i++) {
    for (__typeof(n) j = 0; j < (n); j++) {
      r += ans.m[i][j];
      r %= MOD;
    }
  }
  cout << r;
  return 0;
}