#ifndef BZ
#ifndef __clang__
#pragma GCC optimize "-O3"
#endif
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const ll MOD = 1e9 + 7;

ll n, k;
ll a[210];

int getmin(ll l, ll r) {
	if (l == r)
		return __builtin_popcountll(l);
	int ans = 0;
	for (int x = 60; x >= 0; --x) {
		if ((l >> x) != (r >> x)) {
			ans += 1;
			break;
		}
		else {
			ans += (l >> x) & 1;
		}
	}
	return min(ans, __builtin_popcountll(l));
}

map<vector<ll>, vector<pair<ll, ll> > > mm;
ll b[210];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		cin >> a[i];
	sort(a, a + n);
	for (int x = 0; x <= 60; ++x) {
		vector<ll> vv;
		for (int i = 0; i < n; ++i)
			vv.push_back(a[i] % (1ll << x));
		vv.push_back((1ll << x) - 1);
		sort(ALL(vv));
		vv.resize(unique(ALL(vv)) - vv.begin());
		ll lst = 0;
		for (ll r: vv) {
			ll l = lst;
			int cnt = getmin(l, r);
			if (cnt + x > k || r > a[0])
				continue;
			for (int i = 0; i < n; ++i)
				b[i] = (a[i] - r) >> x;
			vector<ll> vv;
			for (int i = 1; i < n; ++i)
				vv.push_back(b[i] - b[0]);
			mm[vv].emplace_back(max(0ll, b[0] - (k - cnt - x)), b[0] + 1);
			lst = r + 1;
		}
	}
	ll ans = 0;
	for (auto x: mm) {
		auto &vv = x.second;
		sort(vv.begin(), vv.end());
		if (vv.empty())
			continue;
		ll cur = vv[0].first;
		for (auto p: vv) {
			if (p.first <= cur) {
				if (p.second > cur)
					ans += p.second - cur, cur = p.second;
			}
			else {
				ans += p.second - p.first;
				cur = p.second;
			}
		}
	}
	cout << ans % MOD << "\n";
	return 0;
}


