#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=100000+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 1000000007
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n,tot,tp;
ll m,a[360],c[360],d[360];

struct onode{ll fir,cnt,d[360];}o[21050];
bool cmp(onode p,onode q)
{
    rep(i,1,n-1)
    {
        if (p.d[i]<q.d[i]) return 1;
        else if (p.d[i]>q.d[i]) return 0;
    }
    return p.cnt<q.cnt;
}

bool notsame(onode p,onode q)
{
    rep(i,1,n-1)
        if (p.d[i]!=q.d[i]) return 1;
    return 0;
}

int calc(ll x,ll y)
{
    if (x==-1) return 0;
    int ans=1;
    per(i,60,0)
    {
        if (((x>>i)&1)==((y>>i)&1)) ans+=((x>>i)&1);
        else return ans;
    }
    return ans;
}

pair<ll,ll> seg[100100];

int work()
{
    ll ans=0,r=-1,l=0;
    sort(seg+1,seg+1+tp);
    //rep(i,1,tp) cout << seg[i].fir << " " << seg[i].sec << endl;
    //cout << endl;
    rep(i,1,tp)
    {
        if (seg[i].fir>r) 
        {
            ans=(ans+r-l+1)%maxd;l=seg[i].fir;
        }
        r=max(r,seg[i].sec);
    }
    ans=(ans+r-l+1)%maxd;
    return ans;
}

int main()
{
    int T=1;
    while (T--)
    {
        n=read();m=readll();tot=0;
        rep(i,1,n) a[i]=readll();
        sort(a+1,a+1+n);
        rep(k,0,60)
        {
            ll lim=(1ll<<k)-1;
            rep(i,1,n) c[i]=a[i]&lim;
            c[0]=-1;
            sort(c+1,c+1+n);
            int n1=unique(c+1,c+1+n)-c-1;
            rep(i,1,n1)
            {
                if (a[1]<c[i]) continue;
                int mn=calc(c[i-1],c[i]);
                //if (k) cout << c[i-1] << " " << c[i] << " " << mn << endl;
                rep(j,1,n) d[j]=((a[j]-c[i])>>k);
                o[++tot].cnt=k+mn;o[tot].fir=d[1];
                rep(j,1,n-1) o[tot].d[j]=d[j+1]-d[j];
            }
        }
        sort(o+1,o+1+tot,cmp);
        /*rep(i,1,tot)
        {
            cout << o[i].fir << " " << o[i].cnt << endl;
            rep(j,1,n-1) cout << o[i].d[j] << " ";cout << endl;
            cout << endl;
        }*/
        ll ans=0;tp=0;
        rep(i,1,tot)
        {
            if ((i>1) && (notsame(o[i],o[i-1])))
            {
                ans=(ans+work())%maxd;tp=0;
            }
            if (o[i].cnt<=m)
            {
                seg[++tp]=mkp(max(0ll,o[i].fir-(m-o[i].cnt)),o[i].fir);
            }
        }
        ans=(ans+work())%maxd;
        printf("%lld\n",ans);
    }
    return 0;
}
            



Measured memory_bytes: 29440