//2018-1-19
//miaomiao
//
#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define pb push_back
#define For(i, a, b) for(int i = (a); i <= (int)(b); ++i)
#define Forr(i, a, b) for(int i = (a); i >= (int)(b); --i)

#define N (200+5)
#define LOG (60+5)

const int P = 1e9 + 7;

struct node{
	LL b, c;
	bool operator <(const node &rhs)const{return c < rhs.c;}
}h[N];

struct Seg{
	LL l, r;
	bool operator <(const Seg &rhs)const{return l < rhs.l;}
};

int n, m;
LL a[N], num[N];

struct lnode{
	LL l[N];

	bool operator <(const lnode &rhs)const{
		For(i, 1, n)
			if(l[i] < rhs.l[i]) return true;
			else if(l[i] > rhs.l[i]) return false;
		return false;
	}
};

map<lnode, int> ms;
vector<Seg> seg[N*LOG];

int Calc(LL L, LL R){
	LL tmp;
	int tot = 0;

	--L;
	Forr(i, 60, 0){
		tmp = 1ll<<i;
		if(R & tmp) ++tot;
		if((L&tmp) ^ (R&tmp)) return tot;
	}
	return __builtin_popcount(R);
}

lnode now;
void Put(int p, LL rem){
	For(i, 1, p-1){
		num[i] = h[i].b - 1; if(!h[i].b) return;
	}
	For(i, p, n) num[i] = h[i].b;
	sort(num+1, num+n+1);

	LL tmp = num[1];
	For(i, 1, n) now.l[i] = num[i] - tmp;
	if(!ms.count(now)) ms[now] = ++m;
	
	seg[ms[now]].pb((Seg){tmp-min(rem, tmp), tmp});
}

void Solve(){
	LL ans = 0, nl, nr, tot;

	For(si, 1, m){
		sort(seg[si].begin(), seg[si].end());

		tot = 0;
		nl = seg[si][0].l, nr = seg[si][0].r;

		For(i, 1, seg[si].size()-1){
			if(seg[si][i].l > nr){
				tot += nr - nl + 1;
				nl = seg[si][i].l; nr = seg[si][i].r;
			}else nr = max(nr, seg[si][i].r);
		}
		tot += nr - nl + 1;

		ans = (ans + tot%P) % P;
	}

	printf("%lld\n", ans);
}

int main(){
	LL s, tmp, rem;

	scanf("%d%lld", &n, &s);
	For(i, 1, n) scanf("%lld", &a[i]);
	
	For(k, 0, 60){
		tmp = 1ll << k;
		For(i, 1, n){
			h[i].b = a[i]/tmp, h[i].c = a[i]-h[i].b*tmp;
		}
		if(s < k) break;

		sort(h+1, h+n+1);
		
		Put(1, s-k);
		For(i, 2, n) if(h[i-1].c+1 <= h[i].c){
			rem = s - k - Calc(h[i-1].c+1, h[i].c);
			if(rem >= 0) Put(i, rem);
		}
	}

	Solve();

	return 0;
}