#include <bits/stdc++.h>
//#define D
using namespace std;
int main(){
    cin.sync_with_stdio(0);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    vector<int> o; int tmp;
    int zer = 0;
    for(int i = 0; i < n; i++){
        cin >> tmp;
        if(tmp==0){zer++;}
        o.push_back(tmp);
    }
    if(k == 1){cout << n + (n*(n-1))/2 - zer; return 0;}
    unsigned long long sum = 0;
    int a;
    for(int i = 0; i < n; i++){
#ifdef D
        cout << i << ": " << o[i] << '\n';
#endif
        a = o[i];
        if(a >= k){sum += n-i; continue;}
        for(int j = i+1; j < n; j++){
#ifdef D
            cout << '\t' << j << ": " << o[j] << '\n';
#endif
            a |= o[j];
            if(a >= k){
                sum += n-j;
#ifdef D
                cout << "\t\t" << n-j << '\n';
#endif
                break;
            }
        }
    }
    cout << sum;
    return 0;
}
