#include<bits/stdc++.h>
using namespace std;
int a[100000];
int sum(int l, int r){
    int ans = 0;
    //cout<<"("<<l<<","<<r<<")"<<endl;
    for(int i = l ; i <= r ; i++){
       // cout<<"before:"<<ans<<" "<<a[i]<<" ";
        ans = ans|a[i];
        //cout<<"after:"<<ans<<endl;
    }
    return ans;
}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i = 0; i < n ; i++){
        cin>>a[i];
    }
    long long br = 0;
    for(int l = 0; l < n ; l++){
        for(int r = l ; r < n ; r++){
            if(sum(l,r)>= k){
                br++;
            }
        }
    }
    cout<<br;
}
