Problem: There are N non-negative integers written on the blackboard: A_1, ..., A_N.

Snuke can perform the following two operations at most K times in total in any order:

* Operation A: Replace each integer X on the blackboard with X divided by 2, rounded down to the nearest integer.
* Operation B: Replace each integer X on the blackboard with X minus 1. This operation cannot be performed if one or more 0s are written on the blackboard.



Find the number of the different possible combinations of integers written on the blackboard after Snuke performs the operations, modulo 1,000,000,007.

Constraints

* 1 \leq N \leq 200
* 1 \leq A_i \leq 10^{18}
* 1 \leq K \leq 10^{18}
* A_i and K are integers.

Input

Input is given from Standard Input in the following format:


N K
A_1 A_2 ... A_N


Output

Print the number of the different possible combinations of integers written on the blackboard after Snuke performs the operations, modulo 1,000,000,007.

Examples

Input

2 2
5 7


Output

6


Input

3 4
10 13 22


Output

20


Input

1 100
10


Output

11


Input

10 123456789012345678
228344079825412349 478465001534875275 398048921164061989 329102208281783917 779698519704384319 617456682030809556 561259383338846380 254083246422083141 458181156833851984 502254767369499613


Output

164286011

Solution (in CPP):

Solution:
#include<cstdio>
#include<algorithm>
using namespace std;
struct node{long long xx1,xx2,yy1,yy2;};
node b[13001];
struct pt{long long x;int y;};
pt d[211];
int n;
long long a[211],k,s1,s2,mo,c[211],h,cnt,r,s,mi[211],v,sta,sto,ans;
bool cmp(pt aa,pt bb){return(aa.x<bb.x);}
bool cmp1(node aa,node bb){return((aa.xx1<bb.xx1)||((aa.xx1==bb.xx1)&&(aa.xx2<bb.xx2))||((aa.xx1==bb.xx1)&&(aa.xx2==bb.xx2)&&(aa.yy1>bb.yy1)));}
long long ask(long long aa,long long bb)
{
	long long tt=s,w=0;
	if(aa==-1) return(0); 
	while(tt!=0)
	{
		if(bb/tt==1)
		{
			if(aa/tt==0) return(w+1);
			else w++;
		}
		bb=bb%tt;
		aa=aa%tt;
		tt=tt/2;
	}
}
int main()
{
	scanf("%d%lld",&n,&k);
	mo=1000000007;
	h=103;
	for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	s1=0;
	s2=0;
	r=a[1];
	mi[0]=1;
	for(int i=1;i<=n;i++)mi[i]=(mi[i-1]*h)%mo;
	for(int i=2;i<=n;i++) 
	{
		s1=s1+a[i]-a[i-1];
		s2=(s2*k+a[i]-a[i-1])%mo;
		if(r>a[i]) r=a[i];
	}
	cnt=1;
	b[1].xx1=s1;
	b[1].xx2=(s2+mo)%mo;
	b[1].yy1=r;
	if(r>=k) b[1].yy2=k;
	else b[1].yy2=r;
	s=1;
	for(long long j=1;j<=61;j++) if(j<=k)
	{
		for(int i=1;i<=n;i++)
		{
			c[i]=(a[i]%2)*s+c[i];
			a[i]=a[i]/2;
			d[i].x=c[i];
			d[i].y=i;
		} 
		sort(d+1,d+1+n,cmp); 
		d[0].x=-1;
		s1=0;
		s2=0;
		r=a[1];
		for(int i=2;i<=n;i++)
		{
			s1=s1+a[i]-a[i-1];
			s2=(s2*h+a[i]-a[i-1])%mo;
			if(r>a[i]) r=a[i];
		}
		for(int i=1;i<=n;i++) 
		{
			if(d[i].x!=d[i-1].x)
			{
				v=j+ask(d[i-1].x,d[i].x);
				if(v<=k)
				{
					cnt++;
					b[cnt].xx1=s1;
					b[cnt].xx2=(s2+mo)%mo;
					b[cnt].yy1=r;
					if(r>=k-v) b[cnt].yy2=k-v;
					else b[cnt].yy2=r;
				}
			}
			if(a[d[i].y]==0) break;
			if(d[i].y!=1) s2=(s2-mi[n-d[i].y])%mo;
			else s1++;
			if(d[i].y!=n) s2=(s2+mi[n-d[i].y-1])%mo;
			else s1--;
			if(a[d[i].y]-1<r) r=a[d[i].y]-1;
		}
		s=s*2;
	}
	else break;
	sort(b+1,b+1+cnt,cmp1);
	sta=b[1].yy1;
	sto=sta-b[1].yy2; 
	ans=0;
	for(int i=2;i<=cnt;i++)if((b[i].xx1==b[i-1].xx1)&&(b[i].xx2==b[i-1].xx2))
	{
		if(b[i].yy1>=sto)
		{
			if(b[i].yy1-b[i].yy2<sto) sto=b[i].yy1-b[i].yy2;
		}
		else 
		{
			ans=(ans+sta-sto+1)%mo;
			sta=b[i].yy1;
			sto=sta-b[i].yy2;
		}
	}
	else
	{
		ans=(ans+sta-sto+1)%mo;
		sta=b[i].yy1;
		sto=sta-b[i].yy2;
	}
	ans=(ans+sta-sto+1)%mo;
	printf("%lld\n",ans);
}